explain.depesz.com

PostgreSQL's explain analyze made readable

Result: K2hma

Settings
# exclusive inclusive rows x rows loops node
1. 19.332 3,152.496 ↑ 1.0 1 1

Aggregate (cost=3,243,494.01..3,243,494.02 rows=1 width=8) (actual time=3,152.496..3,152.496 rows=1 loops=1)

2. 217.325 3,133.164 ↑ 6.0 141,453 1

Unique (cost=3,226,379.37..3,232,797.36 rows=855,732 width=60) (actual time=2,494.010..3,133.164 rows=141,453 loops=1)

3. 1,778.653 2,915.839 ↓ 1.2 1,052,260 1

Sort (cost=3,226,379.37..3,228,518.70 rows=855,732 width=60) (actual time=2,494.009..2,915.839 rows=1,052,260 loops=1)

  • Sort Key: api_upload.system_uuid, api_report.rule_id
  • Sort Method: external merge Disk: 30,904kB
4. 23.908 1,137.186 ↓ 1.2 1,052,260 1

Gather (cost=1,211.61..3,077,709.67 rows=855,732 width=60) (actual time=4.303..1,137.186 rows=1,052,260 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
5. 242.393 1,113.278 ↑ 1.0 350,753 3 / 3

Hash Join (cost=211.61..2,991,136.47 rows=356,555 width=60) (actual time=2.396..1,113.278 rows=350,753 loops=3)

  • Hash Cond: (api_report.rule_id = api_rule.id)
6. 150.086 869.387 ↓ 1.4 534,051 3 / 3

Nested Loop (cost=19.41..2,989,917.34 rows=389,690 width=20) (actual time=0.671..869.387 rows=534,051 loops=3)

7. 38.696 38.696 ↑ 1.4 48,615 3 / 3

Parallel Index Only Scan using api_upload_account_checked_on_id_sys_index on api_upload (cost=0.56..7,183.01 rows=65,761 width=20) (actual time=0.083..38.696 rows=48,615 loops=3)

  • Index Cond: ((account = '729650'::text) AND (checked_on >= '2019-08-19 00:00:00+00'::timestamp with time zone) AND (checked_on <= '2019-08-26 23:59:59+00'::timestamp with time zone))
  • Heap Fetches: 0
8. 680.324 680.605 ↑ 28.4 11 145,844 / 3

Index Only Scan using api_report_upload_id_rule_id_1a55a613_uniq on api_report (cost=18.85..42.24 rows=312 width=8) (actual time=0.007..0.014 rows=11 loops=145,844)

  • Index Cond: (upload_id = api_upload.id)
  • Filter: (NOT (hashed SubPlan 1))
  • Rows Removed by Filter: 1
  • Heap Fetches: 0
9.          

SubPlan (for Index Only Scan)

10. 0.281 0.281 ↑ 1.0 355 3 / 3

Seq Scan on api_ack u0 (cost=0.00..17.39 rows=355 width=4) (actual time=0.024..0.281 rows=355 loops=3)

  • Filter: ((account)::text = '729650'::text)
  • Rows Removed by Filter: 477
11. 0.325 1.498 ↑ 1.0 985 3 / 3

Hash (cost=179.82..179.82 rows=990 width=4) (actual time=1.498..1.498 rows=985 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 43kB
12. 1.173 1.173 ↑ 1.0 985 3 / 3

Seq Scan on api_rule (cost=0.00..179.82 rows=990 width=4) (actual time=0.017..1.173 rows=985 loops=3)

  • Filter: active
  • Rows Removed by Filter: 91
Planning time : 2.332 ms
Execution time : 3,167.292 ms