explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xTik

Settings
# exclusive inclusive rows x rows loops node
1. 0.008 809.172 ↑ 1.0 50 1

Limit (cost=59,649.44..59,649.94 rows=50 width=17) (actual time=809.148..809.172 rows=50 loops=1)

2. 29.846 809.164 ↑ 6.7 50 1

HashAggregate (cost=59,649.44..59,652.80 rows=336 width=17) (actual time=809.146..809.164 rows=50 loops=1)

3. 37.580 779.318 ↓ 213.7 71,795 1

Merge Left Join (cost=57,849.87..59,646.08 rows=336 width=17) (actual time=714.966..779.318 rows=71,795 loops=1)

  • Merge Cond: (rent_account_equipment.account_good_id = rent_account_equipment_1.account_good_id)
  • Filter: ((rent_account_task_1.status IS NULL) OR ((rent_account_task_1.status)::text = 'not_done'::text))
  • Rows Removed by Filter: 161697
4. 57.472 458.799 ↓ 6.8 69,737 1

Sort (cost=31,859.52..31,885.23 rows=10,285 width=21) (actual time=442.937..458.799 rows=69,737 loops=1)

  • Sort Key: rent_account_good.id
  • Sort Method: external merge Disk: 2112kB
5. 17.038 401.327 ↓ 6.8 69,737 1

Hash Join (cost=21,886.60..31,174.11 rows=10,285 width=21) (actual time=209.686..401.327 rows=69,737 loops=1)

  • Hash Cond: (equipment.good_id = good.id)
6. 55.278 383.839 ↓ 6.8 69,737 1

Hash Join (cost=21,826.11..30,972.20 rows=10,285 width=20) (actual time=209.225..383.839 rows=69,737 loops=1)

  • Hash Cond: (rent_account_equipment.equipment_id = equipment.id)
7. 88.541 295.440 ↓ 2.9 77,092 1

Hash Join (cost=16,577.52..24,924.43 rows=26,844 width=16) (actual time=176.008..295.440 rows=77,092 loops=1)

  • Hash Cond: (rent_account_equipment.account_good_id = rent_account_good.id)
8. 31.089 31.089 ↑ 1.0 421,707 1

Seq Scan on rent_account_equipment (cost=0.00..6,497.07 rows=421,707 width=8) (actual time=0.004..31.089 rows=421,707 loops=1)

9. 2.219 175.810 ↓ 1.7 11,333 1

Hash (cost=16,495.08..16,495.08 rows=6,595 width=12) (actual time=175.810..175.810 rows=11,333 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 487kB
10. 5.365 173.591 ↓ 1.7 11,333 1

Hash Join (cost=11,629.13..16,495.08 rows=6,595 width=12) (actual time=112.322..173.591 rows=11,333 loops=1)

  • Hash Cond: (rent_account_task_good.task_id = rent_account_task.id)
11. 45.270 154.032 ↓ 1.2 16,105 1

Hash Join (cost=9,576.14..14,245.26 rows=13,088 width=16) (actual time=98.111..154.032 rows=16,105 loops=1)

  • Hash Cond: (rent_account_task_good.id = ratg_rag.ratg_id)
12. 12.253 12.253 ↑ 1.0 170,082 1

Seq Scan on rent_account_task_good (cost=0.00..2,624.82 rows=170,082 width=8) (actual time=0.007..12.253 rows=170,082 loops=1)

13. 3.122 96.509 ↓ 1.2 16,105 1

Hash (cost=9,412.54..9,412.54 rows=13,088 width=16) (actual time=96.509..96.509 rows=16,105 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 755kB
14. 51.988 93.387 ↓ 1.2 16,105 1

Hash Join (cost=4,262.41..9,412.54 rows=13,088 width=16) (actual time=29.232..93.387 rows=16,105 loops=1)

  • Hash Cond: (ratg_rag.rag_id = rent_account_good.id)
15. 13.344 13.344 ↑ 1.0 170,589 1

Seq Scan on ratg_rag (cost=0.00..2,886.89 rows=170,589 width=8) (actual time=0.005..13.344 rows=170,589 loops=1)

16. 1.987 28.055 ↓ 1.5 11,917 1

Hash (cost=4,163.05..4,163.05 rows=7,949 width=8) (actual time=28.055..28.055 rows=11,917 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 466kB
17. 12.699 26.068 ↓ 1.5 11,917 1

Hash Join (cost=697.00..4,163.05 rows=7,949 width=8) (actual time=3.552..26.068 rows=11,917 loops=1)

  • Hash Cond: (rent_account_good.account_id = rent_account.id)
18. 9.840 9.840 ↑ 1.0 103,604 1

Seq Scan on rent_account_good (cost=0.00..2,998.04 rows=103,604 width=8) (actual time=0.003..9.840 rows=103,604 loops=1)

19. 0.180 3.529 ↑ 1.1 1,146 1

Hash (cost=681.08..681.08 rows=1,274 width=4) (actual time=3.529..3.529 rows=1,146 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 41kB
20. 3.349 3.349 ↑ 1.1 1,146 1

Seq Scan on rent_account (cost=0.00..681.08 rows=1,274 width=4) (actual time=0.014..3.349 rows=1,146 loops=1)

  • Filter: (((type)::text = 'external'::text) AND ((status)::text = 'in_progress'::text))
  • Rows Removed by Filter: 15459
21. 3.664 14.194 ↓ 1.0 23,016 1

Hash (cost=1,765.54..1,765.54 rows=22,996 width=4) (actual time=14.194..14.194 rows=23,016 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 810kB
22. 10.530 10.530 ↓ 1.0 23,016 1

Seq Scan on rent_account_task (cost=0.00..1,765.54 rows=22,996 width=4) (actual time=0.011..10.530 rows=23,016 loops=1)

  • Filter: (((type)::text = 'transfer'::text) AND ((status)::text = 'completed'::text))
  • Rows Removed by Filter: 22620
23. 9.430 33.121 ↓ 1.0 58,954 1

Hash (cost=4,281.15..4,281.15 rows=58,915 width=8) (actual time=33.121..33.121 rows=58,954 loops=1)

  • Buckets: 4096 Batches: 4 Memory Usage: 593kB
24. 23.691 23.691 ↓ 1.0 58,954 1

Seq Scan on equipment (cost=0.00..4,281.15 rows=58,915 width=8) (actual time=0.007..23.691 rows=58,954 loops=1)

  • Filter: ((status)::text = 'in_use'::text)
  • Rows Removed by Filter: 94818
25. 0.163 0.450 ↑ 1.0 1,133 1

Hash (cost=46.33..46.33 rows=1,133 width=9) (actual time=0.450..0.450 rows=1,133 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 48kB
26. 0.287 0.287 ↑ 1.0 1,133 1

Seq Scan on good (cost=0.00..46.33 rows=1,133 width=9) (actual time=0.004..0.287 rows=1,133 loops=1)

27. 8.613 282.939 ↓ 6.8 179,975 1

Materialize (cost=25,990.35..26,122.02 rows=26,335 width=13) (actual time=272.026..282.939 rows=179,975 loops=1)

28. 14.150 274.326 ↑ 1.4 19,197 1

Sort (cost=25,990.35..26,056.19 rows=26,335 width=13) (actual time=272.021..274.326 rows=19,197 loops=1)

  • Sort Key: rent_account_equipment_1.account_good_id
  • Sort Method: external sort Disk: 488kB
29. 51.457 260.176 ↑ 1.4 19,197 1

Hash Join (cost=15,263.42..23,605.24 rows=26,335 width=13) (actual time=179.892..260.176 rows=19,197 loops=1)

  • Hash Cond: (rent_account_equipment_1.account_good_id = rent_account_good_1.id)
30. 29.088 29.088 ↑ 1.0 421,707 1

Seq Scan on rent_account_equipment rent_account_equipment_1 (cost=0.00..6,497.07 rows=421,707 width=4) (actual time=0.007..29.088 rows=421,707 loops=1)

31. 0.968 179.631 ↑ 1.4 4,744 1

Hash (cost=15,182.55..15,182.55 rows=6,470 width=17) (actual time=179.631..179.631 rows=4,744 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 241kB
32. 5.598 178.663 ↑ 1.4 4,744 1

Hash Join (cost=10,127.92..15,182.55 rows=6,470 width=17) (actual time=117.800..178.663 rows=4,744 loops=1)

  • Hash Cond: (rent_account_task_good_1.task_id = rent_account_task_1.id)
33. 49.442 160.826 ↓ 1.2 16,105 1

Hash Join (cost=8,083.49..12,752.61 rows=13,088 width=12) (actual time=100.552..160.826 rows=16,105 loops=1)

  • Hash Cond: (rent_account_task_good_1.id = ratg_rag_1.ratg_id)
34. 12.091 12.091 ↑ 1.0 170,082 1

Seq Scan on rent_account_task_good rent_account_task_good_1 (cost=0.00..2,624.82 rows=170,082 width=8) (actual time=0.004..12.091 rows=170,082 loops=1)

35. 3.213 99.293 ↓ 1.2 16,105 1

Hash (cost=7,919.89..7,919.89 rows=13,088 width=12) (actual time=99.293..99.293 rows=16,105 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 693kB
36. 55.432 96.080 ↓ 1.2 16,105 1

Hash Join (cost=4,262.41..7,919.89 rows=13,088 width=12) (actual time=28.498..96.080 rows=16,105 loops=1)

  • Hash Cond: (ratg_rag_1.rag_id = rent_account_good_1.id)
37. 13.182 13.182 ↑ 1.0 170,589 1

Seq Scan on ratg_rag ratg_rag_1 (cost=0.00..2,886.89 rows=170,589 width=8) (actual time=0.003..13.182 rows=170,589 loops=1)

38. 1.979 27.466 ↓ 1.5 11,917 1

Hash (cost=4,163.05..4,163.05 rows=7,949 width=4) (actual time=27.466..27.466 rows=11,917 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 419kB
39. 12.511 25.487 ↓ 1.5 11,917 1

Hash Join (cost=697.00..4,163.05 rows=7,949 width=4) (actual time=4.107..25.487 rows=11,917 loops=1)

  • Hash Cond: (rent_account_good_1.account_id = rent_account_1.id)
40. 8.883 8.883 ↑ 1.0 103,604 1

Seq Scan on rent_account_good rent_account_good_1 (cost=0.00..2,998.04 rows=103,604 width=8) (actual time=0.002..8.883 rows=103,604 loops=1)

41. 0.277 4.093 ↑ 1.1 1,146 1

Hash (cost=681.08..681.08 rows=1,274 width=4) (actual time=4.093..4.093 rows=1,146 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 41kB
42. 3.816 3.816 ↑ 1.1 1,146 1

Seq Scan on rent_account rent_account_1 (cost=0.00..681.08 rows=1,274 width=4) (actual time=0.009..3.816 rows=1,146 loops=1)

  • Filter: (((type)::text = 'external'::text) AND ((status)::text = 'in_progress'::text))
  • Rows Removed by Filter: 15459
43. 4.166 12.239 ↓ 1.0 22,563 1

Hash (cost=1,651.45..1,651.45 rows=22,559 width=13) (actual time=12.239..12.239 rows=22,563 loops=1)

  • Buckets: 4096 Batches: 2 Memory Usage: 515kB
44. 8.073 8.073 ↓ 1.0 22,563 1

Seq Scan on rent_account_task rent_account_task_1 (cost=0.00..1,651.45 rows=22,559 width=13) (actual time=0.008..8.073 rows=22,563 loops=1)

  • Filter: ((type)::text = 'return'::text)
  • Rows Removed by Filter: 23073