explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Xbb2T

Settings
# exclusive inclusive rows x rows loops node
1. 54.533 361.293 ↑ 5.2 66 1

GroupAggregate (cost=2,495,643.49..2,497,089.08 rows=340 width=12) (actual time=288.195..361.293 rows=66 loops=1)

  • Group Key: api_rule.id
2. 109.105 306.760 ↑ 1.3 149,151 1

Sort (cost=2,495,643.49..2,496,124.22 rows=192,291 width=20) (actual time=288.171..306.760 rows=149,151 loops=1)

  • Sort Key: api_rule.id
  • Sort Method: external merge Disk: 4384kB
3. 5.220 197.655 ↑ 1.3 149,151 1

Gather (cost=1,260.91..2,474,822.64 rows=192,291 width=20) (actual time=1.872..197.655 rows=149,151 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
4. 30.893 192.435 ↑ 1.5 74,576 2

Hash Join (cost=260.91..2,454,593.54 rows=113,112 width=20) (actual time=1.089..192.435 rows=74,576 loops=2)

  • Hash Cond: (api_report.rule_id = api_rule.id)
5. 150.967 160.553 ↑ 2.1 144,710 2

Nested Loop (cost=1.00..2,453,523.01 rows=307,399 width=20) (actual time=0.082..160.553 rows=144,710 loops=2)

6. 9.574 9.574 ↑ 2.9 10,324 2

Parallel Index Scan using api_upload_current_account_index on api_upload (cost=0.43..102,086.92 rows=29,843 width=20) (actual time=0.058..9.574 rows=10,324 loops=2)

  • Index Cond: ((current = true) AND ((account)::text = '729650'::text))
  • Filter: current
7. 0.012 0.012 ↑ 98.2 14 20,647

Index Only Scan using api_report_upload_id_rule_id_1a55a613_uniq on api_report (cost=0.57..65.04 rows=1,375 width=8) (actual time=0.005..0.012 rows=14 loops=20,647)

  • Index Cond: (upload_id = api_upload.id)
  • Heap Fetches: 118896
8. 0.099 0.989 ↓ 1.1 357 2

Hash (cost=255.66..255.66 rows=340 width=4) (actual time=0.989..0.989 rows=357 loops=2)

  • Buckets: 1024 Batches: 1 Memory Usage: 21kB
9. 0.742 0.890 ↓ 1.1 357 2

Seq Scan on api_rule (cost=17.11..255.66 rows=340 width=4) (actual time=0.256..0.890 rows=357 loops=2)

  • Filter: (active AND (NOT (hashed SubPlan 1)))
  • Rows Removed by Filter: 581
10.          

SubPlan (forSeq Scan)

11. 0.148 0.148 ↑ 1.0 353 2

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

  • Filter: ((account)::text = '729650'::text)
  • Rows Removed by Filter: 386
Planning time : 0.919 ms
Execution time : 362.453 ms