explain.depesz.com

PostgreSQL's explain analyze made readable

Result: g21r

Settings
# exclusive inclusive rows x rows loops node
1. 11.690 166,983.898 ↑ 1.0 1 1

Aggregate (cost=6,758,685.03..6,758,685.04 rows=1 width=8) (actual time=166,983.898..166,983.898 rows=1 loops=1)

2. 493.535 166,972.208 ↑ 17.5 161,337 1

Unique (cost=6,702,089.39..6,723,312.76 rows=2,829,782 width=60) (actual time=165,602.410..166,972.208 rows=161,337 loops=1)

3. 4,495.069 166,478.673 ↓ 1.3 3,552,944 1

Sort (cost=6,702,089.39..6,709,163.85 rows=2,829,782 width=60) (actual time=165,602.408..166,478.673 rows=3,552,944 loops=1)

  • Sort Key: api_upload.system_uuid, api_report.rule_id
  • Sort Method: external merge Disk: 104,320kB
4. 487.110 161,983.604 ↓ 1.3 3,552,944 1

Gather (cost=37,588.92..6,186,053.28 rows=2,829,782 width=60) (actual time=393.258..161,983.604 rows=3,552,944 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
5. 557.850 161,496.494 ↓ 1.0 1,184,315 3 / 3

Hash Join (cost=36,588.92..5,902,075.08 rows=1,179,076 width=60) (actual time=370.475..161,496.494 rows=1,184,315 loops=3)

  • Hash Cond: (api_report.rule_id = api_rule.id)
6. 52,866.449 160,937.542 ↓ 1.4 1,800,996 3 / 3

Hash Join (cost=36,396.73..5,898,486.94 rows=1,288,647 width=20) (actual time=360.283..160,937.542 rows=1,800,996 loops=3)

  • Hash Cond: (api_report.upload_id = api_upload.id)
7. 107,719.056 107,719.301 ↓ 1.5 129,520,681 3 / 3

Parallel Seq Scan on api_report (cost=18.28..4,932,629.78 rows=88,758,740 width=8) (actual time=0.662..107,719.301 rows=129,520,681 loops=3)

  • Filter: (NOT (hashed SubPlan 1))
  • Rows Removed by Filter: 12,493,292
8.          

SubPlan (for Parallel Seq Scan)

9. 0.245 0.245 ↑ 1.0 355 3 / 3

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

  • Filter: ((account)::text = '729650'::text)
  • Rows Removed by Filter: 477
10. 133.749 351.792 ↑ 1.1 477,160 3 / 3

Hash (cost=26,795.56..26,795.56 rows=521,911 width=20) (actual time=351.792..351.792 rows=477,160 loops=3)

  • Buckets: 65,536 Batches: 16 Memory Usage: 2,028kB
11. 218.043 218.043 ↑ 1.1 477,160 3 / 3

Index Only Scan using api_upload_account_checked_on_id_sys_index on api_upload (cost=0.56..26,795.56 rows=521,911 width=20) (actual time=0.346..218.043 rows=477,160 loops=3)

  • Index Cond: ((account = '729650'::text) AND (checked_on >= '2019-07-26 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
12. 0.268 1.102 ↑ 1.0 985 3 / 3

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

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

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

  • Filter: active
  • Rows Removed by Filter: 91
Planning time : 1.943 ms
Execution time : 167,001.619 ms