explain.depesz.com

PostgreSQL's explain analyze made readable

Result: IF34 : Test

Settings
# exclusive inclusive rows x rows loops node
1. 0.010 1,400.097 ↑ 1.0 10 1

Limit (cost=21,486,469.08..21,837,385.85 rows=10 width=1,228) (actual time=1,387.986..1,400.097 rows=10 loops=1)

2. 0.033 1,400.087 ↑ 61.2 10 1

Result (cost=21,486,469.08..42,962,575.40 rows=612 width=1,228) (actual time=1,387.985..1,400.087 rows=10 loops=1)

3. 0.455 1,365.244 ↑ 61.2 10 1

Sort (cost=21,486,469.08..21,486,470.61 rows=612 width=1,220) (actual time=1,365.238..1,365.244 rows=10 loops=1)

  • Sort Key: api_rule.rule_id
  • Sort Method: top-N heapsort Memory: 43kB
4. 0.339 1,364.789 ↑ 1.0 612 1

GroupAggregate (cost=10,743,302.44..21,486,455.85 rows=612 width=1,220) (actual time=1,364.306..1,364.789 rows=612 loops=1)

  • Group Key: api_rule.id, ((SubPlan 1)), ((SubPlan 3))
5. 1.077 1,364.450 ↑ 1.0 612 1

Sort (cost=10,743,302.44..10,743,303.97 rows=612 width=1,253) (actual time=1,364.287..1,364.450 rows=612 loops=1)

  • Sort Key: api_rule.id, ((SubPlan 1)), ((SubPlan 3))
  • Sort Method: quicksort Memory: 1040kB
6. 0.742 1,363.373 ↑ 1.0 612 1

Hash Left Join (cost=1.01..10,743,274.11 rows=612 width=1,253) (actual time=0.049..1,363.373 rows=612 loops=1)

  • Hash Cond: (api_rule.id = api_ack.rule_id)
7. 0.926 0.926 ↑ 1.0 612 1

Seq Scan on api_rule (cost=0.00..140.33 rows=612 width=1,195) (actual time=0.007..0.926 rows=612 loops=1)

  • Filter: active
  • Rows Removed by Filter: 221
8. 0.000 0.005 ↓ 0.0 0 1

Hash (cost=1.00..1.00 rows=1 width=46) (actual time=0.005..0.005 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
9. 0.005 0.005 ↓ 0.0 0 1

Seq Scan on api_ack (cost=0.00..1.00 rows=1 width=46) (actual time=0.005..0.005 rows=0 loops=1)

10.          

SubPlan (forHash Left Join)

11. 0.612 3.672 ↑ 1.0 1 612

GroupAggregate (cost=0.55..16.61 rows=1 width=12) (actual time=0.006..0.006 rows=1 loops=612)

  • Group Key: u1.rule_id
12. 0.552 3.060 ↑ 1.0 1 612

Nested Loop (cost=0.55..16.60 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=612)

13. 1.224 1.224 ↑ 1.0 1 612

Index Scan using api_resolution_rule_id_43e25d91 on api_resolution u1 (cost=0.28..8.29 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=612)

  • Index Cond: (rule_id = api_rule.id)
14. 1.284 1.284 ↑ 1.0 1 642

Index Scan using api_playbook_resolution_id_ce9879e0 on api_playbook u0 (cost=0.28..8.29 rows=1 width=8) (actual time=0.001..0.002 rows=1 loops=642)

  • Index Cond: (resolution_id = u1.id)
15. 0.612 1,358.028 ↓ 0.0 0 612

GroupAggregate (cost=4,020.08..17,537.52 rows=195 width=12) (actual time=2.219..2.219 rows=0 loops=612)

  • Group Key: u1_2.rule_id
16. 169.442 1,357.416 ↑ 495.0 2 612

Hash Join (cost=4,020.08..17,530.62 rows=990 width=8) (actual time=1.508..2.218 rows=2 loops=612)

  • Hash Cond: (u1_2.upload_id = u0_2.id)
17. 1,099.152 1,166.472 ↑ 5.2 902 612

Bitmap Heap Scan on api_report u1_2 (cost=172.73..13,655.80 rows=4,685 width=8) (actual time=0.201..1.906 rows=902 loops=612)

  • Recheck Cond: (rule_id = api_rule.id)
  • Heap Blocks: exact=401197
18. 67.320 67.320 ↑ 5.2 902 612

Bitmap Index Scan on api_report_rule_id_0046fb65 (cost=0.00..171.56 rows=4,685 width=0) (actual time=0.110..0.110 rows=902 loops=612)

  • Index Cond: (rule_id = api_rule.id)
19. 9.123 21.502 ↓ 1.8 60,670 1

Hash (cost=3,415.30..3,415.30 rows=34,564 width=4) (actual time=21.502..21.502 rows=60,670 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 2645kB
20. 12.379 12.379 ↓ 1.8 60,670 1

Bitmap Heap Scan on api_upload u0_2 (cost=1,130.90..3,415.30 rows=34,564 width=4) (actual time=3.542..12.379 rows=60,670 loops=1)

  • Recheck Cond: ((account)::text = '6089719'::text)
  • Filter: current
  • Rows Removed by Filter: 37
  • Heap Blocks: exact=704
  • -> Bitmap Index Scan on api_upload_account_e808b66a_like (cost=0.00..1122.26 rows=60512 width=0) (actual time=3.467..3.467 rows=60707 loops=1
  • Index Cond: ((account)::text = '6089719'::text)
21.          

SubPlan (forResult)

22. 0.000 34.810 ↓ 0.0 0 10

GroupAggregate (cost=4,020.08..17,537.52 rows=195 width=12) (actual time=3.481..3.481 rows=0 loops=10)

  • Group Key: u1_1.rule_id
23. 1.734 34.810 ↓ 0.0 0 10

Hash Join (cost=4,020.08..17,530.62 rows=990 width=8) (actual time=2.524..3.481 rows=0 loops=10)

  • Hash Cond: (u1_1.upload_id = u0_1.id)
24. 9.810 10.490 ↑ 8.8 534 10

Bitmap Heap Scan on api_report u1_1 (cost=172.73..13,655.80 rows=4,685 width=8) (actual time=0.120..1.049 rows=534 loops=10)

  • Recheck Cond: (rule_id = api_rule.id)
  • Heap Blocks: exact=4458
25. 0.680 0.680 ↑ 8.8 534 10

Bitmap Index Scan on api_report_rule_id_0046fb65 (cost=0.00..171.56 rows=4,685 width=0) (actual time=0.068..0.068 rows=534 loops=10)

  • Index Cond: (rule_id = api_rule.id)
26. 9.296 22.586 ↓ 1.8 60,670 1

Hash (cost=3,415.30..3,415.30 rows=34,564 width=4) (actual time=22.586..22.586 rows=60,670 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 2645kB
27. 9.575 13.290 ↓ 1.8 60,670 1

Bitmap Heap Scan on api_upload u0_1 (cost=1,130.90..3,415.30 rows=34,564 width=4) (actual time=3.779..13.290 rows=60,670 loops=1)

  • Recheck Cond: ((account)::text = '6089719'::text)
  • Filter: current
  • Rows Removed by Filter: 37
  • Heap Blocks: exact=704
28. 3.715 3.715 ↓ 1.0 60,707 1

Bitmap Index Scan on api_upload_account_e808b66a_like (cost=0.00..1,122.26 rows=60,512 width=0) (actual time=3.715..3.715 rows=60,707 loops=1)

  • Index Cond: ((account)::text = '6089719'::text)