explain.depesz.com

PostgreSQL's explain analyze made readable

Result: w6bR

Settings
# exclusive inclusive rows x rows loops node
1. 0.219 15,368.883 ↑ 1.0 10 1

Limit (cost=2.96..8.57 rows=10 width=136) (actual time=0.251..15,368.883 rows=10 loops=1)

2. 0.038 15,368.664 ↑ 66,656.8 10 1

Append (cost=2.96..374,266.53 rows=666,568 width=136) (actual time=0.244..15,368.664 rows=10 loops=1)

3. 0.004 0.037 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.96..28.95 rows=1 width=208) (actual time=0.036..0.037 rows=0 loops=1)

4. 0.003 0.033 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.53..26.95 rows=1 width=216) (actual time=0.032..0.033 rows=0 loops=1)

5. 0.003 0.030 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.11..22.23 rows=1 width=214) (actual time=0.029..0.030 rows=0 loops=1)

6. 0.003 0.027 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.69..21.69 rows=1 width=182) (actual time=0.026..0.027 rows=0 loops=1)

7. 0.003 0.024 ↓ 0.0 0 1

Nested Loop (cost=1.27..20.72 rows=1 width=180) (actual time=0.023..0.024 rows=0 loops=1)

8. 0.003 0.021 ↓ 0.0 0 1

Nested Loop (cost=0.84..20.24 rows=1 width=164) (actual time=0.020..0.021 rows=0 loops=1)

9. 0.005 0.018 ↓ 0.0 0 1

Nested Loop (cost=0.42..19.70 rows=1 width=164) (actual time=0.017..0.018 rows=0 loops=1)

10. 0.013 0.013 ↓ 0.0 0 1

Seq Scan on contractcustomers co (cost=0.00..11.25 rows=1 width=172) (actual time=0.012..0.013 rows=0 loops=1)

  • Filter: (customerrolecid = 168001)
11. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_customerships_customerid on customerships cs (cost=0.42..8.44 rows=1 width=24) (never executed)

  • Index Cond: ((customerid)::text = (co.customerkey)::text)
12. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_customerrelations_customershipguid on customerrelations cr (cost=0.42..0.53 rows=1 width=32) (never executed)

  • Index Cond: (customershipguid = cs.idguid)
  • Filter: (typecid = 149001)
13. 0.000 0.000 ↓ 0.0 0

Index Only Scan using "PK_customers" on customers c (cost=0.42..0.48 rows=1 width=16) (never executed)

  • Index Cond: (idguid = cr.customerguid)
  • Heap Fetches: 0
14. 0.000 0.000 ↓ 0.0 0

Index Scan using "PK_customers" on customers c_1 (cost=0.42..0.97 rows=1 width=34) (never executed)

  • Index Cond: (idguid = cr.customerguid)
15. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_customerrelations_customerguid on customerrelations cr_1 (cost=0.42..0.53 rows=1 width=32) (never executed)

  • Index Cond: (customerguid = c.idguid)
  • Filter: (typecid = 149004)
16. 0.000 0.000 ↓ 0.0 0

Index Scan using "PK_customers" on customers c_2 (cost=0.42..4.72 rows=1 width=34) (never executed)

  • Index Cond: (idguid = cr_1.customerguid)
17. 0.000 0.000 ↓ 0.0 0

Index Scan using "PK_customerships" on customerships cs_1 (cost=0.42..2.00 rows=1 width=24) (never executed)

  • Index Cond: (idguid = cr_1.customershipguid)
18. 0.007 0.231 ↑ 1.0 1 1

Nested Loop Left Join (cost=2.96..18.72 rows=1 width=208) (actual time=0.202..0.231 rows=1 loops=1)

19. 0.006 0.219 ↑ 1.0 1 1

Nested Loop Left Join (cost=2.53..16.71 rows=1 width=216) (actual time=0.192..0.219 rows=1 loops=1)

20. 0.000 0.207 ↑ 1.0 1 1

Nested Loop Left Join (cost=2.11..11.99 rows=1 width=214) (actual time=0.182..0.207 rows=1 loops=1)

21. 0.007 0.179 ↑ 1.0 1 1

Nested Loop Left Join (cost=1.69..11.45 rows=1 width=182) (actual time=0.158..0.179 rows=1 loops=1)

22. 0.009 0.158 ↑ 1.0 1 1

Nested Loop (cost=1.27..10.48 rows=1 width=180) (actual time=0.139..0.158 rows=1 loops=1)

23. 0.010 0.129 ↑ 1.0 1 1

Nested Loop (cost=0.84..10.00 rows=1 width=164) (actual time=0.114..0.129 rows=1 loops=1)

24. 0.018 0.095 ↑ 1.0 1 1

Nested Loop (cost=0.42..9.46 rows=1 width=164) (actual time=0.085..0.095 rows=1 loops=1)

25. 0.032 0.032 ↑ 1.0 1 1

Seq Scan on contractcustomers co_1 (cost=0.00..1.01 rows=1 width=148) (actual time=0.029..0.032 rows=1 loops=1)

  • Filter: (customerrolecid = 168001)
26. 0.045 0.045 ↑ 1.0 1 1

Index Scan using idx_customerships_customerid on customerships cs_2 (cost=0.42..8.44 rows=1 width=24) (actual time=0.041..0.045 rows=1 loops=1)

  • Index Cond: ((customerid)::text = (co_1.customerkey)::text)
27. 0.024 0.024 ↑ 1.0 1 1

Index Scan using idx_customerrelations_customershipguid on customerrelations cr_2 (cost=0.42..0.53 rows=1 width=32) (actual time=0.021..0.024 rows=1 loops=1)

  • Index Cond: (customershipguid = cs_2.idguid)
  • Filter: (typecid = 149001)
28. 0.020 0.020 ↑ 1.0 1 1

Index Only Scan using "PK_customers" on customers c_3 (cost=0.42..0.48 rows=1 width=16) (actual time=0.018..0.020 rows=1 loops=1)

  • Index Cond: (idguid = cr_2.customerguid)
  • Heap Fetches: 0
29. 0.014 0.014 ↑ 1.0 1 1

Index Scan using "PK_customers" on customers c_4 (cost=0.42..0.97 rows=1 width=34) (actual time=0.013..0.014 rows=1 loops=1)

  • Index Cond: (idguid = cr_2.customerguid)
30. 0.031 0.031 ↓ 0.0 0 1

Index Scan using idx_customerrelations_customerguid on customerrelations cr_3 (cost=0.42..0.53 rows=1 width=32) (actual time=0.017..0.031 rows=0 loops=1)

  • Index Cond: (customerguid = c_3.idguid)
  • Filter: (typecid = 149004)
  • Rows Removed by Filter: 1
31. 0.006 0.006 ↓ 0.0 0 1

Index Scan using "PK_customers" on customers c_5 (cost=0.42..4.72 rows=1 width=34) (actual time=0.004..0.006 rows=0 loops=1)

  • Index Cond: (idguid = cr_3.customerguid)
32. 0.005 0.005 ↓ 0.0 0 1

Index Scan using "PK_customerships" on customerships cs_3 (cost=0.42..2.00 rows=1 width=24) (actual time=0.003..0.005 rows=0 loops=1)

  • Index Cond: (idguid = cr_3.customershipguid)
33. 0.003 0.027 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.96..28.95 rows=1 width=208) (actual time=0.025..0.027 rows=0 loops=1)

34. 0.002 0.024 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.53..26.95 rows=1 width=216) (actual time=0.022..0.024 rows=0 loops=1)

35. 0.003 0.022 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.11..22.23 rows=1 width=214) (actual time=0.019..0.022 rows=0 loops=1)

36. 0.003 0.019 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.69..21.69 rows=1 width=182) (actual time=0.016..0.019 rows=0 loops=1)

37. 0.000 0.016 ↓ 0.0 0 1

Nested Loop (cost=1.27..20.72 rows=1 width=180) (actual time=0.014..0.016 rows=0 loops=1)

38. 0.017 0.027 ↓ 0.0 0 1

Nested Loop (cost=0.84..20.24 rows=1 width=164) (actual time=0.011..0.027 rows=0 loops=1)

39. 0.003 0.010 ↓ 0.0 0 1

Nested Loop (cost=0.42..19.70 rows=1 width=164) (actual time=0.008..0.010 rows=0 loops=1)

40. 0.007 0.007 ↓ 0.0 0 1

Seq Scan on contractcustomers co_2 (cost=0.00..11.25 rows=1 width=172) (actual time=0.006..0.007 rows=0 loops=1)

  • Filter: (customerrolecid = 168001)
41. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_customerships_customerid on customerships cs_4 (cost=0.42..8.44 rows=1 width=24) (never executed)

  • Index Cond: ((customerid)::text = (co_2.customerkey)::text)
42. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_customerrelations_customershipguid on customerrelations cr_4 (cost=0.42..0.53 rows=1 width=32) (never executed)

  • Index Cond: (customershipguid = cs_4.idguid)
  • Filter: (typecid = 149001)
43. 0.000 0.000 ↓ 0.0 0

Index Only Scan using "PK_customers" on customers c_6 (cost=0.42..0.48 rows=1 width=16) (never executed)

  • Index Cond: (idguid = cr_4.customerguid)
  • Heap Fetches: 0
44. 0.000 0.000 ↓ 0.0 0

Index Scan using "PK_customers" on customers c_7 (cost=0.42..0.97 rows=1 width=34) (never executed)

  • Index Cond: (idguid = cr_4.customerguid)
45. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_customerrelations_customerguid on customerrelations cr_5 (cost=0.42..0.53 rows=1 width=32) (never executed)

  • Index Cond: (customerguid = c_6.idguid)
  • Filter: (typecid = 149004)
46. 0.000 0.000 ↓ 0.0 0

Index Scan using "PK_customers" on customers c_8 (cost=0.42..4.72 rows=1 width=34) (never executed)

  • Index Cond: (idguid = cr_5.customerguid)
47. 0.000 0.000 ↓ 0.0 0

Index Scan using "PK_customerships" on customerships cs_5 (cost=0.42..2.00 rows=1 width=24) (never executed)

  • Index Cond: (idguid = cr_5.customershipguid)
48. 0.002 0.025 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.96..28.95 rows=1 width=208) (actual time=0.023..0.025 rows=0 loops=1)

49. 0.003 0.023 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.53..26.95 rows=1 width=216) (actual time=0.020..0.023 rows=0 loops=1)

50. 0.003 0.020 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.11..22.23 rows=1 width=214) (actual time=0.018..0.020 rows=0 loops=1)

51. 0.002 0.017 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.69..21.69 rows=1 width=182) (actual time=0.015..0.017 rows=0 loops=1)

52. 0.000 0.015 ↓ 0.0 0 1

Nested Loop (cost=1.27..20.72 rows=1 width=180) (actual time=0.012..0.015 rows=0 loops=1)

53. 0.016 0.025 ↓ 0.0 0 1

Nested Loop (cost=0.84..20.24 rows=1 width=164) (actual time=0.009..0.025 rows=0 loops=1)

54. 0.002 0.009 ↓ 0.0 0 1

Nested Loop (cost=0.42..19.70 rows=1 width=164) (actual time=0.006..0.009 rows=0 loops=1)

55. 0.007 0.007 ↓ 0.0 0 1

Seq Scan on contractcustomers co_3 (cost=0.00..11.25 rows=1 width=172) (actual time=0.004..0.007 rows=0 loops=1)

  • Filter: (customerrolecid = 168001)
56. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_customerships_customerid on customerships cs_6 (cost=0.42..8.44 rows=1 width=24) (never executed)

  • Index Cond: ((customerid)::text = (co_3.customerkey)::text)
57. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_customerrelations_customershipguid on customerrelations cr_6 (cost=0.42..0.53 rows=1 width=32) (never executed)

  • Index Cond: (customershipguid = cs_6.idguid)
  • Filter: (typecid = 149001)
58. 0.000 0.000 ↓ 0.0 0

Index Only Scan using "PK_customers" on customers c_9 (cost=0.42..0.48 rows=1 width=16) (never executed)

  • Index Cond: (idguid = cr_6.customerguid)
  • Heap Fetches: 0
59. 0.000 0.000 ↓ 0.0 0

Index Scan using "PK_customers" on customers c_10 (cost=0.42..0.97 rows=1 width=34) (never executed)

  • Index Cond: (idguid = cr_6.customerguid)
60. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_customerrelations_customerguid on customerrelations cr_7 (cost=0.42..0.53 rows=1 width=32) (never executed)

  • Index Cond: (customerguid = c_9.idguid)
  • Filter: (typecid = 149004)
61. 0.000 0.000 ↓ 0.0 0

Index Scan using "PK_customers" on customers c_11 (cost=0.42..4.72 rows=1 width=34) (never executed)

  • Index Cond: (idguid = cr_7.customerguid)
62. 0.000 0.000 ↓ 0.0 0

Index Scan using "PK_customerships" on customerships cs_7 (cost=0.42..2.00 rows=1 width=24) (never executed)

  • Index Cond: (idguid = cr_7.customershipguid)
63. 0.163 15,368.306 ↑ 74,062.7 9 1

Hash Left Join (cost=276,938.30..364,162.43 rows=666,564 width=136) (actual time=15,367.779..15,368.306 rows=9 loops=1)

  • Hash Cond: (c_12.idguid = cr_9.customerguid)
64. 1.252 11,456.042 ↑ 74,062.7 9 1

Hash Join (cost=189,015.04..273,454.13 rows=666,564 width=110) (actual time=11,455.540..11,456.042 rows=9 loops=1)

  • Hash Cond: ((co_4.customerkey)::text = (cs_8.customerid)::text)
65. 0.086 0.086 ↑ 35,117.6 19 1

Seq Scan on contractcustomers co_4 (cost=0.00..54,044.32 rows=667,235 width=76) (actual time=0.019..0.086 rows=19 loops=1)

  • Filter: (customerrolecid = 168001)
  • Rows Removed by Filter: 1
66. 728.278 11,454.704 ↓ 1.0 487,611 1

Hash (cost=178,636.86..178,636.86 rows=487,454 width=42) (actual time=11,454.702..11,454.704 rows=487,611 loops=1)

  • Buckets: 262144 Batches: 4 Memory Usage: 10909kB
67. 1,659.478 10,726.426 ↓ 1.0 487,611 1

Hash Left Join (cost=130,754.70..178,636.86 rows=487,454 width=42) (actual time=4,951.440..10,726.426 rows=487,611 loops=1)

  • Hash Cond: (cr_8.customerguid = c_13.idguid)
68. 1,822.062 7,124.557 ↓ 1.0 487,611 1

Hash Join (cost=55,656.82..90,691.40 rows=487,454 width=40) (actual time=3,007.729..7,124.557 rows=487,611 loops=1)

  • Hash Cond: (cr_8.customerguid = c_12.idguid)
69. 1,585.589 3,731.685 ↓ 1.0 487,611 1

Hash Join (cost=19,895.53..45,467.53 rows=487,454 width=24) (actual time=1,433.352..3,731.685 rows=487,611 loops=1)

  • Hash Cond: (cr_8.customershipguid = cs_8.idguid)
70. 717.144 717.144 ↓ 1.0 487,611 1

Seq Scan on customerrelations cr_8 (cost=0.00..14,768.42 rows=487,454 width=32) (actual time=0.018..717.144 rows=487,611 loops=1)

  • Filter: (typecid = 149001)
  • Rows Removed by Filter: 23383
71. 757.000 1,428.952 ↑ 1.0 487,668 1

Hash (cost=10,941.68..10,941.68 rows=487,668 width=24) (actual time=1,428.948..1,428.952 rows=487,668 loops=1)

  • Buckets: 524288 Batches: 2 Memory Usage: 17446kB
72. 671.952 671.952 ↑ 1.0 487,668 1

Seq Scan on customerships cs_8 (cost=0.00..10,941.68 rows=487,668 width=24) (actual time=0.021..671.952 rows=487,668 loops=1)

73. 825.865 1,570.810 ↑ 1.0 505,595 1

Hash (cost=26,972.35..26,972.35 rows=505,595 width=16) (actual time=1,570.807..1,570.810 rows=505,595 loops=1)

  • Buckets: 524288 Batches: 2 Memory Usage: 15972kB
74. 744.945 744.945 ↑ 1.0 505,595 1

Index Only Scan using "PK_customers" on customers c_12 (cost=0.42..26,972.35 rows=505,595 width=16) (actual time=0.052..744.945 rows=505,595 loops=1)

  • Heap Fetches: 0
75. 768.083 1,942.391 ↑ 1.0 505,595 1

Hash (cost=64,827.95..64,827.95 rows=505,595 width=34) (actual time=1,942.376..1,942.391 rows=505,595 loops=1)

  • Buckets: 262144 Batches: 2 Memory Usage: 18448kB
76. 1,174.308 1,174.308 ↑ 1.0 505,595 1

Seq Scan on customers c_13 (cost=0.00..64,827.95 rows=505,595 width=34) (actual time=0.020..1,174.308 rows=505,595 loops=1)

77. 45.796 3,912.101 ↑ 1.0 21,188 1

Hash (cost=87,652.65..87,652.65 rows=21,649 width=42) (actual time=3,912.100..3,912.101 rows=21,188 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1783kB
78. 751.111 3,866.305 ↑ 1.0 21,188 1

Hash Right Join (cost=20,712.23..87,652.65 rows=21,649 width=42) (actual time=1,757.886..3,866.305 rows=21,188 loops=1)

  • Hash Cond: (c_14.idguid = cr_9.customerguid)
79. 1,357.471 1,357.471 ↑ 1.0 505,595 1

Seq Scan on customers c_14 (cost=0.00..64,827.95 rows=505,595 width=34) (actual time=0.031..1,357.471 rows=505,595 loops=1)

80. 49.483 1,757.723 ↑ 1.0 21,188 1

Hash (cost=20,441.62..20,441.62 rows=21,649 width=24) (actual time=1,757.721..1,757.723 rows=21,188 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1415kB
81. 830.702 1,708.240 ↑ 1.0 21,188 1

Hash Right Join (cost=7,454.70..20,441.62 rows=21,649 width=24) (actual time=51.256..1,708.240 rows=21,188 loops=1)

  • Hash Cond: (cs_9.idguid = cr_9.customershipguid)
82. 826.518 826.518 ↑ 1.0 487,668 1

Seq Scan on customerships cs_9 (cost=0.00..10,941.68 rows=487,668 width=24) (actual time=0.022..826.518 rows=487,668 loops=1)

83. 18.627 51.020 ↑ 1.0 21,188 1

Hash (cost=7,184.08..7,184.08 rows=21,649 width=32) (actual time=51.018..51.020 rows=21,188 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1581kB
84. 32.393 32.393 ↑ 1.0 21,188 1

Index Scan using idx_customerrelations_typecid on customerrelations cr_9 (cost=0.42..7,184.08 rows=21,649 width=32) (actual time=0.068..32.393 rows=21,188 loops=1)

  • Index Cond: (typecid = 149004)
Planning time : 48.846 ms
Execution time : 15,381.620 ms