explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gAIN

Settings
# exclusive inclusive rows x rows loops node
1. 0.157 3,416.059 ↑ 1,414.6 619 1

Append (cost=190,205.22..202,706,449.38 rows=875,643 width=452) (actual time=2,906.137..3,416.059 rows=619 loops=1)

2. 0.544 3,415.891 ↑ 1,414.6 619 1

Subquery Scan on *SELECT* 1 (cost=190,205.22..202,706,424.15 rows=875,642 width=452) (actual time=2,906.137..3,415.891 rows=619 loops=1)

3. 16.631 3,415.347 ↑ 1,414.6 619 1

Hash Left Join (cost=190,205.22..202,697,667.73 rows=875,642 width=452) (actual time=2,906.133..3,415.347 rows=619 loops=1)

  • Hash Cond: (call_event.id_object = o.id)
4. 17.061 3,295.165 ↑ 1,414.6 619 1

Hash Left Join (cost=189,962.77..538,637.38 rows=875,642 width=452) (actual time=2,890.904..3,295.165 rows=619 loops=1)

  • Hash Cond: (call_event.id_full_adress = full_adress.id)
5. 124.374 3,040.644 ↑ 1,414.6 619 1

Hash Left Join (cost=172,559.53..423,265.42 rows=875,642 width=400) (actual time=2,653.400..3,040.644 rows=619 loops=1)

  • Hash Cond: (call_event.id = apa.id)
6. 748.148 2,524.208 ↑ 1,414.6 619 1

Hash Right Join (cost=133,979.12..284,350.37 rows=875,642 width=357) (actual time=2,261.297..2,524.208 rows=619 loops=1)

  • Hash Cond: (ac.id_call = call_event.id)
7. 822.366 822.366 ↑ 1.0 1,683,714 1

Seq Scan on arm03_call ac (cost=0.00..62,197.63 rows=1,686,963 width=62) (actual time=0.015..822.366 rows=1,683,714 loops=1)

8. 7.144 953.694 ↑ 1,414.6 619 1

Hash (cost=87,973.59..87,973.59 rows=875,642 width=301) (actual time=953.694..953.694 rows=619 loops=1)

  • Buckets: 1024 Batches: 512 Memory Usage: 2kB
9. 945.566 946.550 ↑ 1,414.6 619 1

Seq Scan on call_event (cost=855.32..87,973.59 rows=875,642 width=301) (actual time=576.812..946.550 rows=619 loops=1)

  • Filter: (((is_active = 1::numeric) AND (id_main_call IS NULL)) OR (hashed SubPlan 19))
  • Rows Removed by Filter: 1746477
10.          

SubPlan (forSeq Scan)

11. 0.984 0.984 ↑ 1.0 878 1

Index Scan using ref_pult_event_state_index on ref_pult_event (cost=0.28..853.03 rows=914 width=6) (actual time=0.020..0.984 rows=878 loops=1)

12. 169.242 392.062 ↑ 1.0 861,658 1

Hash (cost=19,324.74..19,324.74 rows=864,774 width=49) (actual time=392.062..392.062 rows=861,658 loops=1)

  • Buckets: 2048 Batches: 128 Memory Usage: 264kB
13. 222.820 222.820 ↑ 1.0 861,658 1

Seq Scan on arm03_patient_assistance apa (cost=0.00..19,324.74 rows=864,774 width=49) (actual time=0.006..222.820 rows=861,658 loops=1)

14. 26.738 237.460 ↑ 1.0 98,027 1

Hash (cost=15,118.56..15,118.56 rows=98,294 width=58) (actual time=237.460..237.460 rows=98,027 loops=1)

  • Buckets: 2048 Batches: 16 Memory Usage: 581kB
15. 35.140 210.722 ↑ 1.0 98,027 1

Hash Left Join (cost=6,784.79..15,118.56 rows=98,294 width=58) (actual time=62.097..210.722 rows=98,027 loops=1)

  • Hash Cond: (base_adress.id_street = street.id)
16. 29.815 174.704 ↑ 1.0 98,027 1

Hash Left Join (cost=6,702.23..13,438.72 rows=98,294 width=40) (actual time=61.207..174.704 rows=98,027 loops=1)

  • Hash Cond: (base_adress.id_city = city.id)
17. 72.568 144.666 ↑ 1.0 98,027 1

Hash Left Join (cost=6,681.91..12,066.86 rows=98,294 width=25) (actual time=60.965..144.666 rows=98,027 loops=1)

  • Hash Cond: (full_adress.id_base_adress = base_adress.id)
18. 11.382 11.382 ↑ 1.0 98,027 1

Seq Scan on full_adress (cost=0.00..1,588.94 rows=98,294 width=12) (actual time=0.005..11.382 rows=98,027 loops=1)

19. 37.054 60.716 ↑ 1.0 169,418 1

Hash (cost=3,571.18..3,571.18 rows=169,418 width=19) (actual time=60.716..60.716 rows=169,418 loops=1)

  • Buckets: 2048 Batches: 16 Memory Usage: 545kB
20. 23.662 23.662 ↑ 1.0 169,418 1

Seq Scan on base_adress (cost=0.00..3,571.18 rows=169,418 width=19) (actual time=0.004..23.662 rows=169,418 loops=1)

21. 0.132 0.223 ↑ 1.0 681 1

Hash (cost=11.81..11.81 rows=681 width=25) (actual time=0.223..0.223 rows=681 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 39kB
22. 0.091 0.091 ↑ 1.0 681 1

Seq Scan on city (cost=0.00..11.81 rows=681 width=25) (actual time=0.005..0.091 rows=681 loops=1)

23. 0.576 0.878 ↑ 1.0 2,736 1

Hash (cost=48.36..48.36 rows=2,736 width=28) (actual time=0.878..0.878 rows=2,736 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 162kB
24. 0.302 0.302 ↑ 1.0 2,736 1

Seq Scan on street (cost=0.00..48.36 rows=2,736 width=28) (actual time=0.004..0.302 rows=2,736 loops=1)

25. 0.502 1.416 ↑ 1.0 3,045 1

Hash (cost=203.91..203.91 rows=3,083 width=5) (actual time=1.416..1.416 rows=3,045 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 111kB
26. 0.914 0.914 ↑ 1.0 3,045 1

Seq Scan on objects o (cost=0.00..203.91 rows=3,083 width=5) (actual time=0.010..0.914 rows=3,045 loops=1)

  • Filter: (deleted <> 1::numeric)
  • Rows Removed by Filter: 188
27.          

SubPlan (forHash Left Join)

28. 0.000 1.857 ↓ 0.0 0 619

Limit (cost=0.29..8.31 rows=1 width=6) (actual time=0.003..0.003 rows=0 loops=619)

29. 1.857 1.857 ↓ 0.0 0 619

Index Scan using history_events_idx_5 on history_events history_events_1 (cost=0.29..8.31 rows=1 width=6) (actual time=0.003..0.003 rows=0 loops=619)

  • Index Cond: (id_call = call_event.id)
30. 0.619 6.190 ↓ 0.0 0 619

Subquery Scan on rcv_time1 (cost=8.52..8.53 rows=1 width=8) (actual time=0.010..0.010 rows=0 loops=619)

31. 0.000 5.571 ↓ 0.0 0 619

Limit (cost=8.52..8.52 rows=1 width=20) (actual time=0.009..0.009 rows=0 loops=619)

32. 2.476 5.571 ↓ 0.0 0 619

Sort (cost=8.52..8.53 rows=2 width=20) (actual time=0.009..0.009 rows=0 loops=619)

  • Sort Key: call_tech.id
  • Sort Method: quicksort Memory: 25kB
33. 3.095 3.095 ↑ 2.0 1 619

Index Scan using call_tech_idx on call_tech (cost=0.42..8.51 rows=2 width=20) (actual time=0.005..0.005 rows=1 loops=619)

  • Index Cond: (id_call = call_event.id)
34. 0.619 2.476 ↑ 1.0 1 619

Aggregate (cost=8.52..8.53 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=619)

35. 1.857 1.857 ↓ 0.0 0 619

Index Scan using call_tech_idx on call_tech call_tech_1 (cost=0.42..8.51 rows=2 width=8) (actual time=0.003..0.003 rows=0 loops=619)

  • Index Cond: (id_call = call_event.id)
  • Filter: (at_place_time IS NOT NULL)
  • Rows Removed by Filter: 0
36. 0.619 1.238 ↓ 0.0 0 619

Limit (cost=0.29..8.31 rows=1 width=5) (actual time=0.002..0.002 rows=0 loops=619)

37. 0.619 0.619 ↓ 0.0 0 619

Index Scan using history_events_idx_5 on history_events history_events_2 (cost=0.29..8.31 rows=1 width=5) (actual time=0.001..0.001 rows=0 loops=619)

  • Index Cond: (id_call = call_event.id)
38. 0.619 9.285 ↓ 0.0 0 619

Limit (cost=0.42..13.04 rows=1 width=6) (actual time=0.014..0.015 rows=0 loops=619)

39. 2.856 8.666 ↓ 0.0 0 619

Index Only Scan using call_tech_idx on call_tech call_tech_2 (cost=0.42..25.66 rows=2 width=6) (actual time=0.014..0.014 rows=0 loops=619)

  • Index Cond: (id_call = call_event.id)
  • Heap Fetches: 166
40.          

SubPlan (forIndex Only Scan)

41. 4.980 5.810 ↑ 1.0 1 166

Aggregate (cost=8.57..8.58 rows=1 width=83) (actual time=0.035..0.035 rows=1 loops=166)

42. 0.830 0.830 ↑ 1.0 2 166

Index Scan using call_tech_idx on call_tech ct (cost=0.42..8.52 rows=2 width=83) (actual time=0.004..0.005 rows=2 loops=166)

  • Index Cond: (id_call = call_tech_2.id_call)
  • Filter: (tech_deleted = 0::numeric)
43. 6.809 17.951 ↑ 1.0 1 619

Index Only Scan using arm03_call_call_idx on arm03_call (cost=8.89..16.91 rows=1 width=0) (actual time=0.028..0.029 rows=1 loops=619)

  • Index Cond: (id_call = call_event.id)
  • Heap Fetches: 620
44.          

Initplan (forIndex Only Scan)

45. 9.285 11.142 ↑ 1.0 1 619

Aggregate (cost=8.45..8.46 rows=1 width=53) (actual time=0.018..0.018 rows=1 loops=619)

46. 1.857 1.857 ↑ 1.0 1 619

Index Scan using arm03_call_call_idx on arm03_call a_data (cost=0.43..8.45 rows=1 width=53) (actual time=0.003..0.003 rows=1 loops=619)

  • Index Cond: (id_call = call_event.id)
47. 3.714 7.428 ↑ 1.0 1 619

Limit (cost=0.00..1.34 rows=1 width=20) (actual time=0.012..0.012 rows=1 loops=619)

48. 3.714 3.714 ↑ 1.0 1 619

Seq Scan on event_type (cost=0.00..1.34 rows=1 width=20) (actual time=0.006..0.006 rows=1 loops=619)

  • Filter: (id = call_event.id_event_type)
  • Rows Removed by Filter: 20
49. 0.619 6.190 ↓ 0.0 0 619

Limit (cost=0.14..10.51 rows=1 width=20) (actual time=0.010..0.010 rows=0 loops=619)

50. 3.095 5.571 ↓ 0.0 0 619

Nested Loop Semi Join (cost=0.14..10.51 rows=1 width=20) (actual time=0.009..0.009 rows=0 loops=619)

51. 2.476 2.476 ↓ 0.0 0 619

Seq Scan on call_result_value (cost=0.00..1.16 rows=1 width=40) (actual time=0.004..0.004 rows=0 loops=619)

  • Filter: (id_call = call_event.id)
  • Rows Removed by Filter: 13
52. 0.000 0.000 ↓ 0.0 0

Index Only Scan using event_list_field_set_idx on event_list_field_set (cost=0.14..8.16 rows=1 width=20) (never executed)

  • Index Cond: (id_adv_field = call_result_value.id_field)
  • Heap Fetches: 0
53.          

SubPlan (forNested Loop Semi Join)

54. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=1.17..1.18 rows=1 width=536) (never executed)

55. 0.000 0.000 ↓ 0.0 0

Seq Scan on call_result_value crv (cost=0.00..1.16 rows=1 width=536) (never executed)

  • Filter: (id_call = call_result_value.id_call)
56. 0.000 3.095 ↓ 0.0 0 619

Limit (cost=0.43..2.53 rows=1 width=11) (actual time=0.005..0.005 rows=0 loops=619)

57. 3.095 3.095 ↓ 0.0 0 619

Index Scan using ref_call_event_sound_idx on ref_call_event_sound (cost=0.43..25.67 rows=12 width=11) (actual time=0.005..0.005 rows=0 loops=619)

  • Index Cond: (id_call_event = call_event.id)
  • Filter: (is_out <> 1::numeric)
  • Rows Removed by Filter: 0
58. 0.619 1.857 ↓ 0.0 0 619

Limit (cost=0.28..8.29 rows=1 width=6) (actual time=0.003..0.003 rows=0 loops=619)

59. 1.238 1.238 ↓ 0.0 0 619

Index Scan using linked_event_idx on linked_event (cost=0.28..8.29 rows=1 width=6) (actual time=0.002..0.002 rows=0 loops=619)

  • Index Cond: (id = call_event.id)
60. 0.619 1.857 ↑ 1.0 1 619

Aggregate (cost=8.29..8.30 rows=1 width=35) (actual time=0.003..0.003 rows=1 loops=619)

61. 1.238 1.238 ↓ 0.0 0 619

Index Scan using linked_event_call_idx on linked_event l_event (cost=0.28..8.29 rows=1 width=35) (actual time=0.002..0.002 rows=0 loops=619)

  • Index Cond: (id_call = call_event.id)
62. 0.619 1.857 ↑ 1.0 1 619

Aggregate (cost=12.65..12.66 rows=1 width=44) (actual time=0.003..0.003 rows=1 loops=619)

63. 0.619 1.238 ↓ 0.0 0 619

Bitmap Heap Scan on ref_call_staff (cost=4.18..12.64 rows=4 width=44) (actual time=0.002..0.002 rows=0 loops=619)

  • Recheck Cond: (id_call = call_event.id)
64. 0.619 0.619 ↓ 0.0 0 619

Bitmap Index Scan on ref_call_staff_pk (cost=0.00..4.18 rows=4 width=0) (actual time=0.001..0.001 rows=0 loops=619)

  • Index Cond: (id_call = call_event.id)
65. 3.095 25.998 ↑ 1.0 1 619

Aggregate (cost=7.31..7.32 rows=1 width=147) (actual time=0.042..0.042 rows=1 loops=619)

66. 3.714 22.903 ↓ 0.0 0 619

Limit (cost=0.43..7.30 rows=1 width=188) (actual time=0.037..0.037 rows=0 loops=619)

67. 13.618 19.189 ↓ 0.0 0 619

Nested Loop (cost=0.43..14.16 rows=2 width=188) (actual time=0.031..0.031 rows=0 loops=619)

  • Join Filter: (call_info.id_oper = user_pult.id_user)
  • Rows Removed by Join Filter: 1
68. 5.571 5.571 ↑ 1.1 87 619

Seq Scan on user_pult (cost=0.00..1.99 rows=99 width=8) (actual time=0.003..0.009 rows=87 loops=619)

69. 0.000 0.000 ↓ 0.0 0 53,718

Materialize (cost=0.43..9.21 rows=2 width=185) (actual time=0.000..0.000 rows=0 loops=53,718)

70. 3.714 3.714 ↓ 0.0 0 619

Index Scan using call_info_idx on call_info (cost=0.43..9.20 rows=2 width=185) (actual time=0.006..0.006 rows=0 loops=619)

  • Index Cond: (id_call = call_event.id)
  • Filter: (id_pult IS NULL)
  • Rows Removed by Filter: 1
71. 0.000 9.904 ↑ 1.0 1 619

Limit (cost=115.24..115.25 rows=1 width=151) (actual time=0.016..0.016 rows=1 loops=619)

72. 1.857 9.904 ↑ 1.0 1 619

Aggregate (cost=115.24..115.25 rows=1 width=151) (actual time=0.016..0.016 rows=1 loops=619)

73. 0.291 8.047 ↓ 0.0 0 619

Nested Loop (cost=0.72..115.23 rows=1 width=151) (actual time=0.011..0.013 rows=0 loops=619)

74. 7.428 7.428 ↓ 0.0 0 619

Index Scan using call_action_idx on call_action (cost=0.43..106.92 rows=1 width=77) (actual time=0.009..0.012 rows=0 loops=619)

  • Index Cond: (id_call = call_event.id)
  • Filter: ((id_pult IS NULL) AND (id_action = 65038::numeric) AND (action_deleted = 0::numeric))
  • Rows Removed by Filter: 10
75. 0.328 0.328 ↑ 1.0 1 82

Index Scan using standart_phrases_idx on standart_phrases (cost=0.28..8.30 rows=1 width=80) (actual time=0.003..0.004 rows=1 loops=82)

  • Index Cond: (id = 65038::numeric)
76. 3.714 4.952 ↑ 1.0 1 619

Aggregate (cost=1.01..1.02 rows=1 width=0) (actual time=0.008..0.008 rows=1 loops=619)

77. 1.238 1.238 ↓ 0.0 0 619

Seq Scan on glonass_event_info (cost=0.00..1.01 rows=1 width=0) (actual time=0.002..0.002 rows=0 loops=619)

  • Filter: (id_call = call_event.id)
  • Rows Removed by Filter: 1
78. 0.000 0.011 ↓ 0.0 0 1

Subquery Scan on *SELECT* 2 (cost=2.11..25.22 rows=1 width=128) (actual time=0.011..0.011 rows=0 loops=1)

79. 0.001 0.011 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.11..25.21 rows=1 width=128) (actual time=0.011..0.011 rows=0 loops=1)

80. 0.000 0.010 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.84..16.91 rows=1 width=123) (actual time=0.010..0.010 rows=0 loops=1)

81. 0.001 0.010 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.56..16.60 rows=1 width=105) (actual time=0.010..0.010 rows=0 loops=1)

82. 0.001 0.009 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.28..16.30 rows=1 width=90) (actual time=0.009..0.009 rows=0 loops=1)

83. 0.000 0.008 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.86..15.76 rows=1 width=83) (actual time=0.008..0.008 rows=0 loops=1)

84. 0.000 0.008 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.57..14.37 rows=1 width=83) (actual time=0.008..0.008 rows=0 loops=1)

85. 0.008 0.008 ↓ 0.0 0 1

Index Scan using history_events_new_idx_call_i on history_events (cost=0.29..6.06 rows=1 width=77) (actual time=0.008..0.008 rows=0 loops=1)

  • Index Cond: ((is_active = 1::numeric) AND (id_call IS NULL))
86. 0.000 0.000 ↓ 0.0 0

Index Scan using objects_sys_c0042470 on objects (cost=0.28..8.30 rows=1 width=11) (never executed)

  • Index Cond: (history_events.id_object = id)
87. 0.000 0.000 ↓ 0.0 0

Index Scan using full_adress_sys_c0042551 on full_adress full_adress_1 (cost=0.29..1.38 rows=1 width=12) (never executed)

  • Index Cond: (id = objects.id_full_adress)
88. 0.000 0.000 ↓ 0.0 0

Index Scan using base_adress_main_idx on base_adress base_adress_1 (cost=0.42..0.53 rows=1 width=19) (never executed)

  • Index Cond: (full_adress_1.id_base_adress = id)
89. 0.000 0.000 ↓ 0.0 0

Index Scan using city_sys_c0042422 on city city_1 (cost=0.28..0.29 rows=1 width=25) (never executed)

  • Index Cond: (id = base_adress_1.id_city)
90. 0.000 0.000 ↓ 0.0 0

Index Scan using street_sys_c0042497 on street street_1 (cost=0.28..0.30 rows=1 width=28) (never executed)

  • Index Cond: (id = base_adress_1.id_street)
91. 0.000 0.000 ↓ 0.0 0

Index Scan using rank_sys_c0042610 on rank r (cost=0.28..8.29 rows=1 width=10) (never executed)

  • Index Cond: (history_events.id_rank = id)