explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Fiuv

Settings
# exclusive inclusive rows x rows loops node
1. 265.777 7,675.697 ↑ 1.0 241,560 1

Hash Left Join (cost=375,800.58..587,601.02 rows=241,810 width=2,482) (actual time=5,197.165..7,675.697 rows=241,560 loops=1)

  • Hash Cond: (services.service_type_id = service_types.id)
2. 192.639 7,409.812 ↑ 1.0 241,560 1

Hash Left Join (cost=375,790.94..583,057.45 rows=241,810 width=2,297) (actual time=5,197.003..7,409.812 rows=241,560 loops=1)

  • Hash Cond: (services.worker_vehicle_id = workers_vehicles.id)
3. 141.129 7,210.230 ↑ 1.0 241,560 1

Hash Left Join (cost=375,455.05..579,684.42 rows=241,810 width=1,956) (actual time=5,190.028..7,210.230 rows=241,560 loops=1)

  • Hash Cond: (services.organization_id = organizations.id)
4. 153.488 7,068.563 ↑ 1.0 241,560 1

Hash Left Join (cost=375,429.79..576,334.27 rows=241,810 width=1,803) (actual time=5,189.458..7,068.563 rows=241,560 loops=1)

  • Hash Cond: (services.id = x.service)
5. 103.977 5,577.393 ↑ 1.0 241,560 1

Hash Left Join (cost=263,915.79..458,159.52 rows=241,810 width=1,767) (actual time=3,851.745..5,577.393 rows=241,560 loops=1)

  • Hash Cond: (tasks.cancellation_task_cause_id = cancellation_task_causes.id)
6. 114.749 5,473.394 ↑ 1.0 241,560 1

Merge Left Join (cost=263,914.70..457,231.82 rows=241,810 width=1,726) (actual time=3,851.697..5,473.394 rows=241,560 loops=1)

  • Merge Cond: (tasks.id = t_1.id)
7. 144.200 4,556.622 ↑ 1.0 241,557 1

Merge Left Join (cost=186,401.24..377,376.12 rows=241,810 width=1,692) (actual time=3,083.770..4,556.622 rows=241,557 loops=1)

  • Merge Cond: (tasks.id = tasks_1.id)
8. 150.873 4,007.667 ↑ 1.0 241,557 1

Merge Left Join (cost=134,600.07..320,738.75 rows=241,810 width=1,656) (actual time=2,786.254..4,007.667 rows=241,557 loops=1)

  • Merge Cond: (tasks.id = t.id)
9. 449.820 975.940 ↑ 1.0 241,557 1

Nested Loop Left Join (cost=0.71..181,303.19 rows=241,810 width=1,603) (actual time=0.030..975.940 rows=241,557 loops=1)

10. 284.563 284.563 ↑ 1.0 241,557 1

Index Scan using tasks_pkey on tasks (cost=0.42..90,724.51 rows=241,810 width=1,307) (actual time=0.016..284.563 rows=241,557 loops=1)

11. 241.557 241.557 ↑ 1.0 1 241,557

Index Scan using services_pkey on services (cost=0.29..0.36 rows=1 width=296) (actual time=0.001..0.001 rows=1 loops=241,557)

  • Index Cond: (tasks.service_id = id)
12. 28.839 2,880.854 ↑ 1.0 234,785 1

Materialize (cost=134,599.36..135,808.41 rows=241,810 width=53) (actual time=2,786.215..2,880.854 rows=234,785 loops=1)

13. 241.101 2,852.015 ↑ 1.0 234,785 1

Sort (cost=134,599.36..135,203.89 rows=241,810 width=53) (actual time=2,786.211..2,852.015 rows=234,785 loops=1)

  • Sort Key: t.id
  • Sort Method: external merge Disk: 13984kB
14. 1,486.859 2,610.914 ↑ 1.0 234,785 1

Group (cost=99,269.58..102,292.20 rows=241,810 width=53) (actual time=998.334..2,610.914 rows=234,785 loops=1)

  • Group Key: c.name, t.id, ro.name, rd.name
15. 404.295 1,124.055 ↑ 1.0 234,785 1

Sort (cost=99,269.58..99,874.10 rows=241,810 width=53) (actual time=998.331..1,124.055 rows=234,785 loops=1)

  • Sort Key: c.name, t.id, ro.name, rd.name
  • Sort Method: external merge Disk: 13952kB
16. 62.381 719.760 ↑ 1.0 234,785 1

Hash Join (cost=31,596.17..69,380.51 rows=241,810 width=53) (actual time=268.734..719.760 rows=234,785 loops=1)

  • Hash Cond: (rst.region_destiny_id = rd.id)
17. 64.158 655.115 ↑ 1.0 234,785 1

Hash Join (cost=30,859.60..65,319.06 rows=241,810 width=36) (actual time=266.452..655.115 rows=234,785 loops=1)

  • Hash Cond: (rst.region_origin_id = ro.id)
18. 164.046 588.232 ↑ 1.0 234,785 1

Hash Join (cost=30,075.13..61,209.70 rows=241,810 width=12) (actual time=263.699..588.232 rows=234,785 loops=1)

  • Hash Cond: (t.region_service_type_id = rst.id)
19. 160.736 160.736 ↑ 1.0 241,557 1

Seq Scan on tasks t (cost=0.00..23,564.10 rows=241,810 width=8) (actual time=0.011..160.736 rows=241,557 loops=1)

20. 105.122 263.450 ↓ 1.0 495,925 1

Hash (cost=21,454.17..21,454.17 rows=495,917 width=12) (actual time=263.450..263.450 rows=495,925 loops=1)

  • Buckets: 131072 Batches: 8 Memory Usage: 3700kB
21. 158.328 158.328 ↓ 1.0 495,925 1

Seq Scan on regions_service_types rst (cost=0.00..21,454.17 rows=495,917 width=12) (actual time=0.010..158.328 rows=495,925 loops=1)

22. 0.543 2.725 ↓ 1.0 3,404 1

Hash (cost=741.93..741.93 rows=3,403 width=32) (actual time=2.725..2.725 rows=3,404 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 253kB
23. 1.292 2.182 ↓ 1.0 3,404 1

Hash Join (cost=1.11..741.93 rows=3,403 width=32) (actual time=0.031..2.182 rows=3,404 loops=1)

  • Hash Cond: (ro.country_id = c.id)
24. 0.880 0.880 ↓ 1.0 3,404 1

Seq Scan on regions ro (cost=0.00..694.03 rows=3,403 width=29) (actual time=0.009..0.880 rows=3,404 loops=1)

25. 0.002 0.010 ↑ 1.0 5 1

Hash (cost=1.05..1.05 rows=5 width=11) (actual time=0.010..0.010 rows=5 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
26. 0.008 0.008 ↑ 1.0 5 1

Seq Scan on countries c (cost=0.00..1.05 rows=5 width=11) (actual time=0.007..0.008 rows=5 loops=1)

27. 0.601 2.264 ↓ 1.0 3,404 1

Hash (cost=694.03..694.03 rows=3,403 width=25) (actual time=2.264..2.264 rows=3,404 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 228kB
28. 1.663 1.663 ↓ 1.0 3,404 1

Seq Scan on regions rd (cost=0.00..694.03 rows=3,403 width=25) (actual time=0.014..1.663 rows=3,404 loops=1)

29. 28.909 404.755 ↑ 1.0 241,557 1

Materialize (cost=51,801.16..53,010.21 rows=241,810 width=36) (actual time=297.497..404.755 rows=241,557 loops=1)

30. 206.489 375.846 ↑ 1.0 241,557 1

Sort (cost=51,801.16..52,405.69 rows=241,810 width=36) (actual time=297.491..375.846 rows=241,557 loops=1)

  • Sort Key: tasks_1.id
  • Sort Method: external merge Disk: 10128kB
31. 169.357 169.357 ↑ 1.0 241,557 1

Seq Scan on tasks tasks_1 (cost=0.00..23,564.10 rows=241,810 width=36) (actual time=0.021..169.357 rows=241,557 loops=1)

32. 11.288 802.023 ↑ 1.1 92,349 1

Materialize (cost=77,513.46..78,009.95 rows=99,298 width=34) (actual time=767.920..802.023 rows=92,349 loops=1)

33. 70.049 790.735 ↑ 1.1 92,349 1

Sort (cost=77,513.46..77,761.70 rows=99,298 width=34) (actual time=767.914..790.735 rows=92,349 loops=1)

  • Sort Key: t_1.id
  • Sort Method: external merge Disk: 3672kB
34. 16.889 720.686 ↑ 1.1 92,349 1

Group (cost=64,818.27..65,563.00 rows=99,298 width=34) (actual time=681.141..720.686 rows=92,349 loops=1)

  • Group Key: sh.name, t_1.id
35. 213.848 703.797 ↑ 1.0 98,938 1

Sort (cost=64,818.27..65,066.51 rows=99,298 width=34) (actual time=681.137..703.797 rows=98,938 loops=1)

  • Sort Key: sh.name, t_1.id
  • Sort Method: external merge Disk: 3928kB
36. 23.804 489.949 ↑ 1.0 98,938 1

Hash Join (cost=44,114.77..53,860.79 rows=99,298 width=34) (actual time=239.031..489.949 rows=98,938 loops=1)

  • Hash Cond: (so.hub_id = sh.id)
37. 108.155 465.911 ↑ 1.0 98,938 1

Hash Join (cost=44,090.97..52,471.64 rows=99,298 width=12) (actual time=238.777..465.911 rows=98,938 loops=1)

  • Hash Cond: (sot.sodimac_order_id = so.id)
38. 103.352 254.588 ↑ 1.0 98,938 1

Hash Join (cost=27,531.72..32,782.05 rows=99,298 width=12) (actual time=135.223..254.588 rows=98,938 loops=1)

  • Hash Cond: (sot.task_id = t_1.id)
39. 16.301 16.301 ↑ 1.0 98,949 1

Seq Scan on sodimac_order_tasks sot (cost=0.00..1,969.98 rows=99,298 width=12) (actual time=0.015..16.301 rows=98,949 loops=1)

40. 45.783 134.935 ↑ 1.0 241,557 1

Hash (cost=23,564.10..23,564.10 rows=241,810 width=4) (actual time=134.935..134.935 rows=241,557 loops=1)

  • Buckets: 131072 Batches: 4 Memory Usage: 3150kB
41. 89.152 89.152 ↑ 1.0 241,557 1

Seq Scan on tasks t_1 (cost=0.00..23,564.10 rows=241,810 width=4) (actual time=0.012..89.152 rows=241,557 loops=1)

42. 36.500 103.168 ↓ 1.0 163,086 1

Hash (cost=13,731.33..13,731.33 rows=162,633 width=16) (actual time=103.168..103.168 rows=163,086 loops=1)

  • Buckets: 131072 Batches: 4 Memory Usage: 2935kB
43. 66.668 66.668 ↓ 1.0 163,086 1

Seq Scan on sodimac_orders so (cost=0.00..13,731.33 rows=162,633 width=16) (actual time=0.012..66.668 rows=163,086 loops=1)

44. 0.091 0.234 ↑ 1.1 590 1

Hash (cost=15.58..15.58 rows=658 width=38) (actual time=0.234..0.234 rows=590 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 50kB
45. 0.143 0.143 ↑ 1.1 590 1

Seq Scan on sodimac_hubs sh (cost=0.00..15.58 rows=658 width=38) (actual time=0.020..0.143 rows=590 loops=1)

46. 0.004 0.022 ↑ 1.0 4 1

Hash (cost=1.04..1.04 rows=4 width=41) (actual time=0.022..0.022 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
47. 0.018 0.018 ↑ 1.0 4 1

Seq Scan on cancellation_task_causes (cost=0.00..1.04 rows=4 width=41) (actual time=0.017..0.018 rows=4 loops=1)

48. 5.545 1,337.682 ↓ 219.0 43,800 1

Hash (cost=111,511.50..111,511.50 rows=200 width=36) (actual time=1,337.682..1,337.682 rows=43,800 loops=1)

  • Buckets: 65536 (originally 1024) Batches: 1 (originally 1) Memory Usage: 2380kB
49. 28.372 1,332.137 ↓ 219.0 43,800 1

Sort (cost=111,509.00..111,509.50 rows=200 width=36) (actual time=1,320.429..1,332.137 rows=43,800 loops=1)

  • Sort Key: x.service DESC
  • Sort Method: quicksort Memory: 3419kB
50.          

CTE x

51. 97.445 1,201.853 ↑ 3.6 66,314 1

GroupAggregate (cost=100,011.38..104,847.58 rows=241,810 width=16) (actual time=1,048.882..1,201.853 rows=66,314 loops=1)

  • Group Key: t_2.region_service_type_id, s.id
52. 265.385 1,104.408 ↑ 1.0 234,784 1

Sort (cost=100,011.38..100,615.90 rows=241,810 width=8) (actual time=1,048.833..1,104.408 rows=234,784 loops=1)

  • Sort Key: t_2.region_service_type_id, s.id
  • Sort Method: external merge Disk: 4128kB
53. 102.128 839.023 ↑ 1.0 234,784 1

Hash Join (cost=33,972.59..75,081.82 rows=241,810 width=8) (actual time=273.506..839.023 rows=234,784 loops=1)

  • Hash Cond: (t_2.service_id = s.id)
54. 57.111 722.984 ↑ 1.0 234,785 1

Hash Join (cost=30,659.60..68,443.94 rows=241,810 width=8) (actual time=259.483..722.984 rows=234,785 loops=1)

  • Hash Cond: (rst_1.region_origin_id = origen.id)
55. 56.237 663.792 ↑ 1.0 234,785 1

Hash Join (cost=30,367.36..64,826.82 rows=241,810 width=12) (actual time=257.370..663.792 rows=234,785 loops=1)

  • Hash Cond: (rst_1.region_destiny_id = destino.id)
56. 176.393 605.531 ↑ 1.0 234,785 1

Hash Join (cost=30,075.13..61,209.70 rows=241,810 width=16) (actual time=255.325..605.531 rows=234,785 loops=1)

  • Hash Cond: (t_2.region_service_type_id = rst_1.id)
57. 174.075 174.075 ↑ 1.0 241,557 1

Seq Scan on tasks t_2 (cost=0.00..23,564.10 rows=241,810 width=8) (actual time=0.029..174.075 rows=241,557 loops=1)

58. 104.580 255.063 ↓ 1.0 495,925 1

Hash (cost=21,454.17..21,454.17 rows=495,917 width=12) (actual time=255.063..255.063 rows=495,925 loops=1)

  • Buckets: 131072 Batches: 8 Memory Usage: 3700kB
59. 150.483 150.483 ↓ 1.0 495,925 1

Seq Scan on regions_service_types rst_1 (cost=0.00..21,454.17 rows=495,917 width=12) (actual time=0.011..150.483 rows=495,925 loops=1)

60. 0.398 2.024 ↓ 1.0 3,404 1

Hash (cost=249.70..249.70 rows=3,403 width=8) (actual time=2.024..2.024 rows=3,404 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 165kB
61. 1.010 1.626 ↓ 1.0 3,404 1

Merge Join (cost=0.56..249.70 rows=3,403 width=8) (actual time=0.022..1.626 rows=3,404 loops=1)

  • Merge Cond: (destino.id = origen1.id)
62. 0.287 0.287 ↓ 1.0 3,404 1

Index Only Scan using regions_pkey on regions destino (cost=0.28..99.33 rows=3,403 width=4) (actual time=0.010..0.287 rows=3,404 loops=1)

  • Heap Fetches: 15
63. 0.329 0.329 ↓ 1.0 3,404 1

Index Only Scan using regions_pkey on regions origen1 (cost=0.28..99.33 rows=3,403 width=4) (actual time=0.010..0.329 rows=3,404 loops=1)

  • Heap Fetches: 15
64. 0.409 2.081 ↓ 1.0 3,404 1

Hash (cost=249.70..249.70 rows=3,403 width=8) (actual time=2.081..2.081 rows=3,404 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 165kB
65. 1.013 1.672 ↓ 1.0 3,404 1

Merge Join (cost=0.56..249.70 rows=3,403 width=8) (actual time=0.040..1.672 rows=3,404 loops=1)

  • Merge Cond: (origen.id = destino1.id)
66. 0.305 0.305 ↓ 1.0 3,404 1

Index Only Scan using regions_pkey on regions origen (cost=0.28..99.33 rows=3,403 width=4) (actual time=0.025..0.305 rows=3,404 loops=1)

  • Heap Fetches: 15
67. 0.354 0.354 ↓ 1.0 3,404 1

Index Only Scan using regions_pkey on regions destino1 (cost=0.28..99.33 rows=3,403 width=4) (actual time=0.010..0.354 rows=3,404 loops=1)

  • Heap Fetches: 15
68. 6.251 13.911 ↓ 1.0 44,285 1

Hash (cost=2,761.94..2,761.94 rows=44,084 width=4) (actual time=13.911..13.911 rows=44,285 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 2069kB
69. 7.660 7.660 ↓ 1.0 44,285 1

Index Only Scan using services_pkey on services s (cost=0.29..2,761.94 rows=44,084 width=4) (actual time=0.023..7.660 rows=44,285 loops=1)

  • Heap Fetches: 4539
70. 84.439 1,303.765 ↓ 219.0 43,800 1

HashAggregate (cost=6,649.77..6,653.77 rows=200 width=36) (actual time=1,272.686..1,303.765 rows=43,800 loops=1)

  • Group Key: x.service
71. 1,219.326 1,219.326 ↑ 3.6 66,314 1

CTE Scan on x (cost=0.00..4,836.20 rows=241,810 width=12) (actual time=1,048.887..1,219.326 rows=66,314 loops=1)

72. 0.254 0.538 ↓ 1.0 549 1

Hash (cost=18.45..18.45 rows=545 width=153) (actual time=0.538..0.538 rows=549 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 106kB
73. 0.284 0.284 ↓ 1.0 549 1

Seq Scan on organizations (cost=0.00..18.45 rows=545 width=153) (actual time=0.028..0.284 rows=549 loops=1)

74. 1.375 6.943 ↑ 1.0 1,613 1

Hash (cost=315.73..315.73 rows=1,613 width=341) (actual time=6.943..6.943 rows=1,613 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 495kB
75. 1.242 5.568 ↑ 1.0 1,613 1

Hash Left Join (cost=241.24..315.73 rows=1,613 width=341) (actual time=3.152..5.568 rows=1,613 loops=1)

  • Hash Cond: (workers_vehicles.worker_id = users.id)
76. 1.000 1.809 ↑ 1.0 1,613 1

Hash Left Join (cost=49.56..101.87 rows=1,613 width=117) (actual time=0.547..1.809 rows=1,613 loops=1)

  • Hash Cond: (workers_vehicles.vehicle_id = vehicles.id)
77. 0.295 0.295 ↑ 1.0 1,613 1

Seq Scan on workers_vehicles (cost=0.00..30.13 rows=1,613 width=32) (actual time=0.016..0.295 rows=1,613 loops=1)

78. 0.215 0.514 ↓ 1.0 1,315 1

Hash (cost=33.14..33.14 rows=1,314 width=85) (actual time=0.514..0.514 rows=1,315 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 176kB
79. 0.299 0.299 ↓ 1.0 1,315 1

Seq Scan on vehicles (cost=0.00..33.14 rows=1,314 width=85) (actual time=0.012..0.299 rows=1,315 loops=1)

80. 1.627 2.517 ↓ 1.0 4,234 1

Hash (cost=139.08..139.08 rows=4,208 width=224) (actual time=2.517..2.517 rows=4,234 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 767kB
81. 0.890 0.890 ↓ 1.0 4,234 1

Seq Scan on users (cost=0.00..139.08 rows=4,208 width=224) (actual time=0.011..0.890 rows=4,234 loops=1)

82. 0.058 0.108 ↑ 1.0 117 1

Hash (cost=8.17..8.17 rows=117 width=201) (actual time=0.108..0.108 rows=117 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 36kB
83. 0.050 0.050 ↑ 1.0 117 1

Seq Scan on service_types (cost=0.00..8.17 rows=117 width=201) (actual time=0.012..0.050 rows=117 loops=1)