explain.depesz.com

PostgreSQL's explain analyze made readable

Result: WPLx

Settings
# exclusive inclusive rows x rows loops node
1. 55.964 1,214.296 ↑ 5.2 66 1

GroupAggregate (cost=482,062.69..486,218.03 rows=340 width=12) (actual time=1,137.728..1,214.296 rows=66 loops=1)

  • Group Key: api_rule.id
2. 72.501 1,158.332 ↑ 3.7 149,263 1

Sort (cost=482,062.69..483,446.67 rows=553,592 width=20) (actual time=1,137.713..1,158.332 rows=149,263 loops=1)

  • Sort Key: api_rule.id
  • Sort Method: external merge Disk: 4392kB
3. 1.795 1,085.831 ↑ 3.7 149,263 1

Gather (cost=36,844.71..417,900.27 rows=553,592 width=20) (actual time=151.029..1,085.831 rows=149,263 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
4. 19.242 1,084.036 ↑ 4.6 49,754 3

Hash Join (cost=35,844.71..361,541.07 rows=230,663 width=20) (actual time=144.280..1,084.036 rows=49,754 loops=3)

  • Hash Cond: (api_report.rule_id = api_rule.id)
5. 312.800 1,063.431 ↑ 6.5 96,486 3

Merge Join (cost=35,664.80..359,708.11 rows=626,861 width=20) (actual time=142.862..1,063.431 rows=96,486 loops=3)

  • Merge Cond: (api_report.upload_id = api_upload.id)
6. 606.490 606.490 ↑ 1.3 4,654,837 3

Parallel Index Only Scan using api_report_upload_id_rule_id_1a55a613_uniq on api_report (cost=0.43..301,697.87 rows=6,252,974 width=8) (actual time=0.053..606.490 rows=4,654,837 loops=3)

  • Heap Fetches: 0
7. 8.259 144.141 ↑ 5.2 20,634 3

Sort (cost=35,571.45..35,840.33 rows=107,552 width=20) (actual time=142.132..144.141 rows=20,634 loops=3)

  • Sort Key: api_upload.id
  • Sort Method: quicksort Memory: 2381kB
8. 135.882 135.882 ↑ 5.2 20,634 3

Seq Scan on api_upload (cost=0.00..24,374.46 rows=107,552 width=20) (actual time=0.146..135.882 rows=20,634 loops=3)

  • Filter: (current AND ((account)::text = '729650'::text))
  • Rows Removed by Filter: 1052203
9. 0.120 1.363 ↑ 1.0 337 3

Hash (cost=175.66..175.66 rows=340 width=4) (actual time=1.363..1.363 rows=337 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 20kB
10. 1.032 1.243 ↑ 1.0 337 3

Seq Scan on api_rule (cost=17.11..175.66 rows=340 width=4) (actual time=0.377..1.243 rows=337 loops=3)

  • Filter: (active AND (NOT (hashed SubPlan 1)))
  • Rows Removed by Filter: 587
11.          

SubPlan (forSeq Scan)

12. 0.211 0.211 ↑ 1.0 353 3

Seq Scan on api_ack (cost=0.00..16.23 rows=353 width=4) (actual time=0.024..0.211 rows=353 loops=3)

  • Filter: ((account)::text = '729650'::text)
  • Rows Removed by Filter: 385