explain.depesz.com

A tool for finding a real cause for slow queries.

Result: vWK

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 0.176 122.186 ↑ 11.3 3 1

GroupAggregate (cost=46127.31..46131.22 rows=34 width=498) (actual time=122.148..122.186 rows=3 loops=1)

2. 0.238 122.010 ↑ 4.9 7 1

Sort (cost=46127.31..46127.39 rows=34 width=498) (actual time=122.006..122.010 rows=7 loops=1)

  • Sort Key: "*SELECT* 1".evi_name, "*SELECT* 1".sektorius, "*SELECT* 1".cti_name, "*SELECT* 1".hall_name, "*SELECT* 1".ev_event_date
  • Sort Method: quicksort Memory: 18kB
3. 0.005 121.772 ↑ 4.9 7 1

Append (cost=764.20..46126.10 rows=34 width=155) (actual time=8.685..121.772 rows=7 loops=1)

4. 0.009 8.686 ↑ 30.0 1 1

Subquery Scan on "*SELECT* 1" (cost=764.20..766.45 rows=30 width=161) (actual time=8.684..8.686 rows=1 loops=1)

5. 0.194 8.677 ↑ 30.0 1 1

HashAggregate (cost=764.20..766.15 rows=30 width=161) (actual time=8.677..8.677 rows=1 loops=1)

6. 0.067 8.483 ↑ 1.4 22 1

Hash Left Join (cost=505.98..762.77 rows=30 width=161) (actual time=8.027..8.483 rows=22 loops=1)

  • Hash Cond: (tex.city.ct_id = tex.city_info.cti_city_id)
7. 0.055 8.278 ↑ 1.4 22 1

Hash Join (cost=500.85..757.21 rows=30 width=151) (actual time=7.844..8.278 rows=22 loops=1)

  • Hash Cond: (tex.hall.hall_city_id = tex.city.ct_id)
8. 0.045 8.125 ↑ 1.4 22 1

Hash Join (cost=496.89..752.84 rows=30 width=151) (actual time=7.713..8.125 rows=22 loops=1)

  • Hash Cond: (tex.plan.plan_hall_id = tex.hall.hall_id)
9. 0.072 7.725 ↑ 1.4 22 1

Hash Join (cost=486.10..741.63 rows=30 width=155) (actual time=7.335..7.725 rows=22 loops=1)

  • Hash Cond: (agg_report_by_sector.aggs_sector_id = tex.sector.sec_id)
10. 0.038 2.157 ↑ 1.4 22 1

Hash Left Join (cost=338.07..593.03 rows=30 width=152) (actual time=1.788..2.157 rows=22 loops=1)

  • Hash Cond: (agg_report_by_sector.aggs_sector_id = agg_real_fakt_of_event_sector.aggr_sec_sector_id)
  • Join Filter: (agg_report_by_sector.aggs_event_id = agg_report_by_sector.aggs_event_id)
11. 0.025 2.111 ↑ 1.4 22 1

Nested Loop (cost=316.59..568.62 rows=30 width=112) (actual time=1.757..2.111 rows=22 loops=1)

12. 0.146 1.954 ↑ 1.4 22 1

Hash Join (cost=316.59..336.01 rows=30 width=87) (actual time=1.723..1.954 rows=22 loops=1)

  • Hash Cond: (tex.hall_info.hi_hall_id = tex.plan.plan_hall_id)
13. 0.351 0.351 ↑ 1.0 389 1

Seq Scan on hall_info (cost=0.00..17.66 rows=389 width=27) (actual time=0.035..0.351 rows=389 loops=1)

  • Filter: (hi_language = 4)
14. 0.016 1.457 ↑ 1.4 22 1

Hash (cost=316.22..316.22 rows=30 width=60) (actual time=1.457..1.457 rows=22 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 2kB
15. 0.297 1.441 ↑ 1.4 22 1

Hash Join (cost=294.91..316.22 rows=30 width=60) (actual time=1.087..1.441 rows=22 loops=1)

  • Hash Cond: (tex.plan.plan_id = tex.event.ev_plan_id)
16. 0.345 0.345 ↑ 1.0 867 1

Seq Scan on plan (cost=0.00..16.67 rows=867 width=8) (actual time=0.009..0.345 rows=867 loops=1)

17. 0.022 0.799 ↑ 1.4 22 1

Hash (cost=294.54..294.54 rows=30 width=60) (actual time=0.799..0.799 rows=22 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 2kB
18. 0.058 0.777 ↑ 1.4 22 1

Nested Loop (cost=4.30..294.54 rows=30 width=60) (actual time=0.051..0.777 rows=22 loops=1)

19. 0.587 0.587 ↑ 1.4 22 1

Seq Scan on agg_report_by_sector (cost=0.00..44.83 rows=30 width=44) (actual time=0.018..0.587 rows=22 loops=1)

  • Filter: (((aggs_event_id = ANY ('{11385}'::integer[])) OR ((-1) = ANY ('{11385}'::integer[]))) AND (aggs_date >= '2012-01-01'::date) AND (aggs_date <= '2012-05-20'::date))
20. 0.044 0.132 ↑ 1.0 1 22

Bitmap Heap Scan on event (cost=4.30..8.31 rows=1 width=16) (actual time=0.006..0.006 rows=1 loops=22)

  • Recheck Cond: (tex.event.ev_id = agg_report_by_sector.aggs_event_id)
21. 0.088 0.088 ↑ 1.0 1 22

Bitmap Index Scan on event_pkey (cost=0.00..4.30 rows=1 width=0) (actual time=0.004..0.004 rows=1 loops=22)

  • Index Cond: (tex.event.ev_id = agg_report_by_sector.aggs_event_id)
22. 0.132 0.132 ↑ 1.0 1 22

Index Scan using index_ev_id_language on event_info (cost=0.00..7.74 rows=1 width=29) (actual time=0.005..0.006 rows=1 loops=22)

  • Index Cond: ((tex.event_info.evi_event_id = tex.event.ev_id) AND (tex.event_info.evi_language = 4))
23. 0.001 0.008 ↓ 0.0 0 1

Hash (cost=15.10..15.10 rows=510 width=48) (actual time=0.008..0.008 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 0kB
24. 0.007 0.007 ↓ 0.0 0 1

Seq Scan on agg_real_fakt_of_event_sector (cost=0.00..15.10 rows=510 width=48) (actual time=0.007..0.007 rows=0 loops=1)

25. 3.052 5.496 ↑ 1.0 5068 1

Hash (cost=84.68..84.68 rows=5068 width=11) (actual time=5.496..5.496 rows=5068 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 163kB
26. 2.444 2.444 ↑ 1.0 5068 1

Seq Scan on sector (cost=0.00..84.68 rows=5068 width=11) (actual time=0.009..2.444 rows=5068 loops=1)

27. 0.188 0.355 ↑ 1.0 391 1

Hash (cost=5.91..5.91 rows=391 width=8) (actual time=0.355..0.355 rows=391 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
28. 0.167 0.167 ↑ 1.0 391 1

Seq Scan on hall (cost=0.00..5.91 rows=391 width=8) (actual time=0.009..0.167 rows=391 loops=1)

29. 0.045 0.098 ↑ 1.0 87 1

Hash (cost=2.87..2.87 rows=87 width=4) (actual time=0.098..0.098 rows=87 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 3kB
30. 0.053 0.053 ↑ 1.0 87 1

Seq Scan on city (cost=0.00..2.87 rows=87 width=4) (actual time=0.021..0.053 rows=87 loops=1)

31. 0.049 0.138 ↑ 1.0 84 1

Hash (cost=4.08..4.08 rows=84 width=14) (actual time=0.138..0.138 rows=84 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 3kB
32. 0.089 0.089 ↑ 1.0 84 1

Seq Scan on city_info (cost=0.00..4.08 rows=84 width=14) (actual time=0.020..0.089 rows=84 loops=1)

  • Filter: (cti_language = 4)
33. 0.022 26.876 ↑ 1.0 3 1

Subquery Scan on "*SELECT* 2" (cost=39910.80..39911.49 rows=3 width=111) (actual time=26.868..26.876 rows=3 loops=1)

34. 0.306 26.854 ↑ 1.0 3 1

HashAggregate (cost=39910.80..39911.46 rows=3 width=111) (actual time=26.849..26.854 rows=3 loops=1)

35. 0.061 26.548 ↓ 6.0 18 1

Hash Join (cost=1762.47..39910.69 rows=3 width=111) (actual time=22.411..26.548 rows=18 loops=1)

  • Hash Cond: (tex.event.ev_id = tex.ticket.tick_event_id)
36. 0.044 26.268 ↑ 72.0 3 1

Hash Join (cost=240.49..38387.07 rows=216 width=85) (actual time=22.148..26.268 rows=3 loops=1)

  • Hash Cond: (tex.event.ev_plan_id = tex.plan.plan_id)
37. 0.065 22.471 ↑ 75.3 3 1

Hash Join (cost=148.03..38291.61 rows=226 width=56) (actual time=18.353..22.471 rows=3 loops=1)

  • Hash Cond: (tex.event.ev_plan_id = tex.sector.sec_plan_id)
38. 0.008 16.905 ↑ 44.0 1 1

Nested Loop (cost=0.00..38132.08 rows=44 width=45) (actual time=12.790..16.905 rows=1 loops=1)

39. 16.882 16.882 ↑ 44.0 1 1

Index Scan using index_ev_plan_id on event (cost=0.00..37783.46 rows=44 width=16) (actual time=12.770..16.882 rows=1 loops=1)

  • Filter: ((ev_id = ANY ('{11385}'::integer[])) OR ((-1) = ANY ('{11385}'::integer[])))
40. 0.015 0.015 ↑ 1.0 1 1

Index Scan using index_ev_id_language on event_info (cost=0.00..7.91 rows=1 width=29) (actual time=0.013..0.015 rows=1 loops=1)

  • Index Cond: ((tex.event_info.evi_event_id = tex.event.ev_id) AND (tex.event_info.evi_language = 4))
41. 3.214 5.501 ↑ 1.0 5068 1

Hash (cost=84.68..84.68 rows=5068 width=11) (actual time=5.501..5.501 rows=5068 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 163kB
42. 2.287 2.287 ↑ 1.0 5068 1

Seq Scan on sector (cost=0.00..84.68 rows=5068 width=11) (actual time=0.008..2.287 rows=5068 loops=1)

43. 0.718 3.753 ↓ 1.0 866 1

Hash (cost=82.09..82.09 rows=830 width=41) (actual time=3.753..3.753 rows=866 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 51kB
44. 0.787 3.035 ↓ 1.0 866 1

Hash Join (cost=53.90..82.09 rows=830 width=41) (actual time=1.997..3.035 rows=866 loops=1)

  • Hash Cond: (tex.plan.plan_hall_id = tex.hall.hall_id)
45. 0.283 0.283 ↑ 1.0 867 1

Seq Scan on plan (cost=0.00..16.67 rows=867 width=8) (actual time=0.005..0.283 rows=867 loops=1)

46. 0.306 1.965 ↓ 1.0 387 1

Hash (cost=49.23..49.23 rows=373 width=45) (actual time=1.965..1.965 rows=387 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 25kB
47. 0.354 1.659 ↓ 1.0 387 1

Hash Join (cost=21.04..49.23 rows=373 width=45) (actual time=0.773..1.659 rows=387 loops=1)

  • Hash Cond: (tex.hall.hall_city_id = tex.city.ct_id)
48. 0.352 0.961 ↑ 1.0 389 1

Hash Join (cost=10.80..33.81 rows=389 width=35) (actual time=0.399..0.961 rows=389 loops=1)

  • Hash Cond: (tex.hall_info.hi_hall_id = tex.hall.hall_id)
49. 0.250 0.250 ↑ 1.0 389 1

Seq Scan on hall_info (cost=0.00..17.66 rows=389 width=27) (actual time=0.015..0.250 rows=389 loops=1)

  • Filter: (hi_language = 4)
50. 0.201 0.359 ↑ 1.0 391 1

Hash (cost=5.91..5.91 rows=391 width=8) (actual time=0.359..0.359 rows=391 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
51. 0.158 0.158 ↑ 1.0 391 1

Seq Scan on hall (cost=0.00..5.91 rows=391 width=8) (actual time=0.006..0.158 rows=391 loops=1)

52. 0.069 0.344 ↑ 1.0 84 1

Hash (cost=9.19..9.19 rows=84 width=18) (actual time=0.344..0.344 rows=84 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 4kB
53. 0.148 0.275 ↑ 1.0 84 1

Hash Join (cost=3.96..9.19 rows=84 width=18) (actual time=0.156..0.275 rows=84 loops=1)

  • Hash Cond: (tex.city_info.cti_city_id = tex.city.ct_id)
54. 0.056 0.056 ↑ 1.0 84 1

Seq Scan on city_info (cost=0.00..4.08 rows=84 width=14) (actual time=0.006..0.056 rows=84 loops=1)

  • Filter: (cti_language = 4)
55. 0.027 0.071 ↑ 1.0 87 1

Hash (cost=2.87..2.87 rows=87 width=4) (actual time=0.071..0.071 rows=87 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 3kB
56. 0.044 0.044 ↑ 1.0 87 1

Seq Scan on city (cost=0.00..2.87 rows=87 width=4) (actual time=0.003..0.044 rows=87 loops=1)

57. 0.012 0.219 ↑ 19.1 7 1

Hash (cost=1520.30..1520.30 rows=134 width=34) (actual time=0.219..0.219 rows=7 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
58. 0.015 0.207 ↑ 19.1 7 1

Nested Loop (cost=0.00..1520.30 rows=134 width=34) (actual time=0.125..0.207 rows=7 loops=1)

59. 0.101 0.101 ↑ 19.1 7 1

Index Scan using index_sal_print_date on sales (cost=0.00..358.13 rows=134 width=34) (actual time=0.080..0.101 rows=7 loops=1)

  • Index Cond: (sal_print_date >= ('now'::text)::date)
  • Filter: (sal_printed AND (sal_payment_method_id <> 8))
60. 0.091 0.091 ↑ 1.0 1 7

Index Scan using ticket_pkey on ticket (cost=0.00..8.66 rows=1 width=8) (actual time=0.012..0.013 rows=1 loops=7)

  • Index Cond: (tex.ticket.tick_id = sales.sal_tick_id)
61. 0.041 86.205 ↓ 3.0 3 1

Subquery Scan on "*SELECT* 3" (cost=5448.06..5448.17 rows=1 width=110) (actual time=86.197..86.205 rows=3 loops=1)

62. 28.260 86.164 ↓ 3.0 3 1

HashAggregate (cost=5448.06..5448.16 rows=1 width=110) (actual time=86.160..86.164 rows=3 loops=1)

63. 4.647 57.904 ↓ 4236.0 4236 1

Nested Loop Left Join (cost=1913.52..5448.04 rows=1 width=110) (actual time=15.951..57.904 rows=4236 loops=1)

64. 4.510 44.785 ↓ 4236.0 4236 1

Nested Loop (cost=1913.52..5439.02 rows=1 width=96) (actual time=15.894..44.785 rows=4236 loops=1)

65. 5.394 23.331 ↓ 4236.0 4236 1

Hash Join (cost=1913.52..5434.74 rows=1 width=90) (actual time=15.870..23.331 rows=4236 loops=1)

  • Hash Cond: (ticket_has_ticket_price.thtp_tick_id = tex.ticket.tick_id)
66. 0.971 2.176 ↓ 2.4 1412 1

Nested Loop (cost=0.00..3516.02 rows=593 width=14) (actual time=0.068..2.176 rows=1412 loops=1)

67. 0.030 0.030 ↓ 1.7 5 1

Index Scan using index_price_event_id on ticket_price (cost=0.00..12.95 rows=3 width=14) (actual time=0.027..0.030 rows=5 loops=1)

  • Index Cond: (price_event_id = 11385)
68. 1.175 1.175 ↑ 1.3 282 5

Index Scan using idx_thtp_price_id on ticket_has_ticket_price (cost=0.00..1163.28 rows=353 width=8) (actual time=0.020..0.235 rows=282 loops=5)

  • Index Cond: (ticket_has_ticket_price.thtp_price_id = ticket_price.price_id)
69. 8.492 15.761 ↓ 1.3 4236 1

Hash (cost=1873.66..1873.66 rows=3189 width=88) (actual time=15.761..15.761 rows=4236 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 674kB
70. 3.467 7.269 ↓ 1.3 4236 1

Nested Loop (cost=0.00..1873.66 rows=3189 width=88) (actual time=0.219..7.269 rows=4236 loops=1)

71. 0.008 0.223 ↑ 1.7 3 1

Nested Loop (cost=0.00..56.85 rows=5 width=75) (actual time=0.146..0.223 rows=3 loops=1)

72. 0.041 0.178 ↑ 1.0 1 1

Nested Loop (cost=0.00..40.53 rows=1 width=76) (actual time=0.119..0.178 rows=1 loops=1)

  • Join Filter: (tex.hall.hall_city_id = tex.city.ct_id)
73. 0.006 0.105 ↑ 1.0 1 1

Nested Loop (cost=0.00..36.58 rows=1 width=72) (actual time=0.069..0.105 rows=1 loops=1)

74. 0.004 0.068 ↑ 1.0 1 1

Nested Loop (cost=0.00..28.29 rows=1 width=47) (actual time=0.058..0.068 rows=1 loops=1)

75. 0.003 0.037 ↑ 1.0 1 1

Nested Loop (cost=0.00..21.31 rows=1 width=32) (actual time=0.031..0.037 rows=1 loops=1)

76. 0.006 0.026 ↑ 1.0 1 1

Nested Loop (cost=0.00..17.02 rows=1 width=24) (actual time=0.022..0.026 rows=1 loops=1)

77. 0.012 0.012 ↑ 1.0 1 1

Index Scan using event_pkey on event (cost=0.00..8.74 rows=1 width=16) (actual time=0.011..0.012 rows=1 loops=1)

  • Index Cond: (ev_id = 11385)
78. 0.008 0.008 ↑ 1.0 1 1

Index Scan using plan_pkey on plan (cost=0.00..8.27 rows=1 width=8) (actual time=0.007..0.008 rows=1 loops=1)

  • Index Cond: (tex.plan.plan_id = tex.event.ev_plan_id)
79. 0.008 0.008 ↑ 1.0 1 1

Index Scan using hall_pkey on hall (cost=0.00..4.27 rows=1 width=8) (actual time=0.006..0.008 rows=1 loops=1)

  • Index Cond: (tex.hall.hall_id = tex.plan.plan_hall_id)
80. 0.027 0.027 ↑ 1.0 1 1

Index Scan using index_hall_id_language on hall_info (cost=0.00..6.98 rows=1 width=27) (actual time=0.024..0.027 rows=1 loops=1)

  • Index Cond: ((tex.hall_info.hi_hall_id = tex.plan.plan_hall_id) AND (tex.hall_info.hi_language = 4))
81. 0.031 0.031 ↑ 1.0 1 1

Index Scan using index_ev_id_language on event_info (cost=0.00..8.27 rows=1 width=29) (actual time=0.007..0.031 rows=1 loops=1)

  • Index Cond: ((tex.event_info.evi_event_id = 11385) AND (tex.event_info.evi_language = 4))
82. 0.032 0.032 ↑ 1.0 87 1

Seq Scan on city (cost=0.00..2.87 rows=87 width=4) (actual time=0.005..0.032 rows=87 loops=1)

83. 0.037 0.037 ↑ 2.0 3 1

Index Scan using index_sec_plan_id on sector (cost=0.00..16.24 rows=6 width=11) (actual time=0.023..0.037 rows=3 loops=1)

  • Index Cond: (tex.sector.sec_plan_id = tex.event.ev_plan_id)
84. 1.970 3.579 ↓ 2.2 1412 3

Materialize (cost=0.00..1778.89 rows=632 width=17) (actual time=0.020..1.193 rows=1412 loops=3)

85. 1.609 1.609 ↓ 2.2 1412 1

Index Scan using idx_ticket_event_id on ticket (cost=0.00..1775.73 rows=632 width=17) (actual time=0.039..1.609 rows=1412 loops=1)

  • Index Cond: (tick_event_id = 11385)
86. 16.944 16.944 ↑ 1.0 1 4236

Index Scan using idx_city_id_language on city_info (cost=0.00..4.27 rows=1 width=14) (actual time=0.003..0.004 rows=1 loops=4236)

  • Index Cond: ((tex.city_info.cti_city_id = tex.city.ct_id) AND (tex.city_info.cti_language = 4))
87. 8.472 8.472 ↓ 0.0 0 4236

Index Scan using receipt_pkey on receipt (cost=0.00..9.00 rows=1 width=14) (actual time=0.002..0.002 rows=0 loops=4236)

  • Index Cond: (receipt.rec_id = tex.ticket.tick_receipt_id)
  • Filter: ((receipt.rec_start_date)::date >= ('now'::text)::date)