explain.depesz.com

PostgreSQL's explain analyze made readable

Result: UBrX : Optimization for: plan #4ylP

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 3.144 3,292.195 ↑ 1.0 30 1

Limit (cost=4,311,357.83..4,311,357.9 rows=30 width=2,814) (actual time=3,289.052..3,292.195 rows=30 loops=1)

  • Buffers: shared hit=431,355
2. 0.345 3,289.051 ↑ 3.8 30 1

Sort (cost=4,311,357.83..4,311,358.12 rows=115 width=2,814) (actual time=3,289.05..3,289.051 rows=30 loops=1)

  • Sort Key: all_tickets.category_label
  • Sort Method: top-N heapsort Memory: 70kB
  • Buffers: shared hit=405,611
3. 9.559 3,288.706 ↓ 5.3 609 1

Sort (cost=4,311,352.99..4,311,353.28 rows=115 width=2,814) (actual time=3,288.673..3,288.706 rows=609 loops=1)

  • Sort Key: all_tickets.incoming_update DESC NULLS LAST, all_tickets.is_worked_ticket, all_tickets.substatus_order_column, all_tickets.is_nonbroadband DESC, all_tickets.ticket_id, all_tickets.last_update_duration DESC NULLS LAST
  • Sort Method: quicksort Memory: 701kB
  • Buffers: shared hit=405,611
4. 1.171 3,279.147 ↓ 5.3 609 1

Subquery Scan on all_tickets (cost=3,968,672.6..4,311,349.06 rows=115 width=2,814) (actual time=1,079.039..3,279.147 rows=609 loops=1)

  • Filter: (all_tickets.client_segment_id = 1)
  • Buffers: shared hit=405,611
5. 9.757 3,277.976 ↑ 12.8 1,788 1

Unique (cost=3,968,672.6..4,311,062.65 rows=22,913 width=2,814) (actual time=1,078.777..3,277.976 rows=1,788 loops=1)

  • Buffers: shared hit=405,611
6. 182.679 3,268.219 ↓ 1.1 45,310 1

Nested Loop (cost=3,968,672.6..4,310,963.08 rows=39,828 width=2,814) (actual time=1,078.771..3,268.219 rows=45,310 loops=1)

  • Buffers: shared hit=405,611
7. 813.346 2,994.920 ↓ 1.1 45,310 1

Nested Loop (cost=3,968,672.18..4,284,824.15 rows=39,828 width=765) (actual time=1,078.659..2,994.92 rows=45,310 loops=1)

  • Buffers: shared hit=224,555
8. 778.139 2,045.644 ↓ 1.1 45,310 1

Nested Loop (cost=3,968,672.18..4,238,123.98 rows=39,828 width=762) (actual time=1,078.622..2,045.644 rows=45,310 loops=1)

  • Buffers: shared hit=224,554
9. 37.005 1,176.885 ↓ 1.1 45,310 1

Nested Loop (cost=3,968,672.18..4,191,423.81 rows=39,828 width=759) (actual time=1,078.581..1,176.885 rows=45,310 loops=1)

  • Buffers: shared hit=224,553
10. 1.097 1,118.056 ↑ 20.1 1,984 1

Nested Loop (cost=3,968,672.18..4,042,061.69 rows=39,828 width=752) (actual time=1,078.479..1,118.056 rows=1,984 loops=1)

  • Buffers: shared hit=224,549
11. 2.197 1,114.975 ↑ 20.1 1,984 1

Nested Loop (cost=3,968,671.76..4,022,703.66 rows=39,828 width=749) (actual time=1,078.466..1,114.975 rows=1,984 loops=1)

  • Buffers: shared hit=222,950
12. 2.453 1,110.794 ↑ 20.1 1,984 1

Nested Loop (cost=3,968,671.61..4,016,232.85 rows=39,828 width=734) (actual time=1,078.443..1,110.794 rows=1,984 loops=1)

  • Buffers: shared hit=219,078
13. 4.588 1,100.405 ↑ 20.1 1,984 1

Nested Loop (cost=3,968,671.19..3,996,874.82 rows=39,828 width=727) (actual time=1,078.413..1,100.405 rows=1,984 loops=1)

  • Buffers: shared hit=211,307
14. 3.030 1,085.897 ↑ 20.1 1,984 1

Merge Join (cost=3,968,670.76..3,971,603.88 rows=39,828 width=698) (actual time=1,078.367..1,085.897 rows=1,984 loops=1)

  • Buffers: shared hit=203,534
15. 4.433 1,011.992 ↑ 20.1 1,984 1

Sort (cost=2,636,870.98..2,636,970.55 rows=39,828 width=682) (actual time=1,011.002..1,011.992 rows=1,984 loops=1)

  • Sort Key: t.id
  • Sort Method: quicksort Memory: 1,794kB
  • Buffers: shared hit=149,133
16. 2.377 1,007.559 ↑ 20.1 1,984 1

Hash Join (cost=2,560,216.65..2,633,827.83 rows=39,828 width=682) (actual time=572.401..1,007.559 rows=1,984 loops=1)

  • Buffers: shared hit=149,133
17. 0.801 859.106 ↑ 20.1 1,984 1

Hash Join (cost=2,542,092.79..2,615,599.41 rows=39,828 width=671) (actual time=424.919..859.106 rows=1,984 loops=1)

  • Buffers: shared hit=139,172
18. 0.897 858.285 ↑ 20.1 1,984 1

Hash Join (cost=2,542,091.25..2,615,478.14 rows=39,828 width=659) (actual time=424.886..858.285 rows=1,984 loops=1)

  • Buffers: shared hit=139,171
19. 1.791 857.271 ↑ 20.1 1,984 1

Hash Join (cost=2,542,080.11..2,615,360.95 rows=39,828 width=648) (actual time=424.725..857.271 rows=1,984 loops=1)

  • Buffers: shared hit=139,166
20. 2.711 769.303 ↑ 20.1 1,984 1

Nested Loop (cost=2,533,251.74..2,606,428.03 rows=39,828 width=644) (actual time=338.518..769.303 rows=1,984 loops=1)

  • Buffers: shared hit=138,218
21. 223.019 758.656 ↑ 20.1 1,984 1

Hash Join (cost=2,533,251.31..2,584,557.15 rows=39,828 width=596) (actual time=338.502..758.656 rows=1,984 loops=1)

  • Buffers: shared hit=130,447
22. 198.201 198.201 ↑ 1.0 2,800,986 1

Seq Scan on ticket_service ts (cost=0..40,403.86 rows=2,800,986 width=8) (actual time=0.01..198.201 rows=2,800,986 loops=1)

  • Buffers: shared hit=12,394
23. 1.666 337.436 ↑ 12.8 1,788 1

Hash (cost=2,532,964.9..2,532,964.9 rows=22,913 width=592) (actual time=337.435..337.436 rows=1,788 loops=1)

  • Buffers: shared hit=118,053
24. 0.756 335.770 ↑ 12.8 1,788 1

Hash Join (cost=2,260,638.36..2,532,964.9 rows=22,913 width=592) (actual time=320.048..335.77 rows=1,788 loops=1)

  • Buffers: shared hit=118,053
25. 0.611 334.999 ↑ 12.8 1,788 1

Hash Join (cost=2,260,636.62..2,532,895.42 rows=22,913 width=578) (actual time=320.026..334.999 rows=1,788 loops=1)

  • Buffers: shared hit=118,052
26. 0.492 334.345 ↑ 12.8 1,788 1

Nested Loop (cost=2,260,631.6..2,532,828.53 rows=22,913 width=555) (actual time=319.975..334.345 rows=1,788 loops=1)

  • Buffers: shared hit=118,050
27. 1.212 330.277 ↑ 12.8 1,788 1

Nested Loop (cost=2,260,631.18..2,522,680.73 rows=22,913 width=538) (actual time=319.96..330.277 rows=1,788 loops=1)

  • Buffers: shared hit=110,898
28. 0.520 323.701 ↑ 12.8 1,788 1

Hash Join (cost=2,260,630.75..2,349,400.6 rows=22,913 width=522) (actual time=319.945..323.701 rows=1,788 loops=1)

  • Buffers: shared hit=103,743
29. 0.629 323.149 ↑ 12.8 1,788 1

Hash Join (cost=2,260,627.52..2,349,334.65 rows=22,913 width=509) (actual time=319.906..323.149 rows=1,788 loops=1)

  • Buffers: shared hit=103,742
30. 1.030 322.079 ↑ 12.8 1,788 1

Hash Join (cost=2,260,576.71..2,349,223.55 rows=22,913 width=494) (actual time=319.453..322.079 rows=1,788 loops=1)

  • Buffers: shared hit=103,728
31. 0.000 176.818 ↑ 12.8 1,788 1

Hash Join (cost=1,319,179.48..1,407,766.18 rows=22,913 width=490) (actual time=174.852..176.818 rows=1,788 loops=1)

  • Buffers: shared hit=72,988
32. 47.821 110.711 ↑ 12.8 1,788 1

Gather (cost=12,632.26..101,158.81 rows=22,913 width=486) (actual time=107.2..110.711 rows=1,788 loops=1)

  • Workers Planned: 3
  • Workers Launched: 3
  • Buffers: shared hit=18,586
33. 0.195 62.890 ↑ 16.5 447 4 / 4

Hash Join (cost=11,632.26..97,867.51 rows=7,391 width=486) (actual time=51.342..62.89 rows=447 loops=4)

  • Buffers: shared hit=18,586
34. 0.181 62.648 ↑ 16.5 447 4 / 4

Hash Join (cost=11,626.29..97,759.91 rows=7,391 width=473) (actual time=51.285..62.648 rows=447 loops=4)

  • Buffers: shared hit=18,570
35. 1.398 62.444 ↑ 16.5 447 4 / 4

Hash Join (cost=11,624.61..97,736.49 rows=7,391 width=466) (actual time=51.254..62.444 rows=447 loops=4)

  • Buffers: shared hit=18,566
36. 0.160 51.397 ↑ 16.5 447 4 / 4

Hash Join (cost=8,940.25..95,032.72 rows=7,391 width=446) (actual time=41.192..51.397 rows=447 loops=4)

  • Buffers: shared hit=17,239
37. 0.190 51.232 ↑ 16.5 447 4 / 4

Nested Loop (cost=8,939.16..94,995.78 rows=7,391 width=440) (actual time=41.177..51.232 rows=447 loops=4)

  • Buffers: shared hit=17,235
38. 0.198 50.595 ↑ 16.5 447 4 / 4

Hash Join (cost=8,938.74..89,705.44 rows=7,391 width=440) (actual time=41.17..50.595 rows=447 loops=4)

  • Buffers: shared hit=16,580
39. 0.426 50.381 ↑ 16.5 447 4 / 4

Nested Loop (cost=8,937.65..89,668.49 rows=7,391 width=434) (actual time=41.145..50.381 rows=447 loops=4)

  • Buffers: shared hit=16,576
40. 0.224 49.955 ↑ 16.5 447 4 / 4

Nested Loop (cost=8,937.36..85,500.92 rows=7,391 width=426) (actual time=41.138..49.955 rows=447 loops=4)

  • Buffers: shared hit=16,087
41. 0.159 47.049 ↑ 16.5 447 4 / 4

Hash Join (cost=8,937.07..81,333.36 rows=7,391 width=422) (actual time=41.107..47.049 rows=447 loops=4)

  • Buffers: shared hit=10,758
42. 0.175 46.875 ↑ 16.5 447 4 / 4

Hash Join (cost=8,936.02..81,312.82 rows=7,391 width=423) (actual time=41.083..46.875 rows=447 loops=4)

  • Buffers: shared hit=10,754
43. 0.255 46.677 ↑ 16.5 447 4 / 4

Nested Loop (cost=8,934.89..81,291.93 rows=7,391 width=413) (actual time=41.048..46.677 rows=447 loops=4)

  • Buffers: shared hit=10,750
44. 1.498 45.975 ↑ 16.5 447 4 / 4

Hash Join (cost=8,934.46..75,094.32 rows=7,391 width=402) (actual time=41.024..45.975 rows=447 loops=4)

  • Buffers: shared hit=9,075
45. 4.403 4.536 ↑ 16.5 447 4 / 4

Bitmap Heap Scan on ticket t (cost=487.29..66,627.74 rows=7,391 width=357) (actual time=0.834..4.536 rows=447 loops=4)

  • Heap Blocks: exact=1
  • Buffers: shared hit=1,659
46. 0.133 0.133 ↑ 12.8 1,788 1 / 4

Bitmap Index Scan on ticket_idx2 (cost=0..481.56 rows=22,913 width=0) (actual time=0.53..0.53 rows=1,788 loops=1)

  • Index Cond: ((t.status = 0) AND (t.ticket_queue_id = 181))
  • Buffers: shared hit=9
47. 9.201 39.941 ↑ 1.7 27,498 4 / 4

Hash (cost=7,874.3..7,874.3 rows=45,830 width=49) (actual time=39.941..39.941 rows=27,498 loops=4)

  • Buffers: shared hit=7,416
48. 30.740 30.740 ↑ 1.7 27,498 4 / 4

Seq Scan on client client (cost=0..7,874.3 rows=45,830 width=49) (actual time=0.017..30.74 rows=27,498 loops=4)

  • Buffers: shared hit=7,416
49. 0.447 0.447 ↓ 0.0 0 1,788 / 4

Index Scan using person_id_key on person incident_manager (cost=0.42..0.84 rows=1 width=19) (actual time=0.001..0.001 rows=0 loops=1,788)

  • Index Cond: (incident_manager.id = client.incident_manager_id)
  • Buffers: shared hit=1,675
50. 0.003 0.023 ↑ 1.0 6 4 / 4

Hash (cost=1.06..1.06 rows=6 width=14) (actual time=0.023..0.023 rows=6 loops=4)

  • Buffers: shared hit=4
51. 0.020 0.020 ↑ 1.0 6 4 / 4

Seq Scan on ticket_escalation_level ticket_escalation_level (cost=0..1.06 rows=6 width=14) (actual time=0.018..0.02 rows=6 loops=4)

  • Buffers: shared hit=4
52. 0.002 0.015 ↑ 1.0 2 4 / 4

Hash (cost=1.02..1.02 rows=2 width=7) (actual time=0.015..0.015 rows=2 loops=4)

  • Buffers: shared hit=4
53. 0.013 0.013 ↑ 1.0 2 4 / 4

Seq Scan on yes_or_no is_sensitive (cost=0..1.02 rows=2 width=7) (actual time=0.012..0.013 rows=2 loops=4)

  • Buffers: shared hit=4
54. 2.682 2.682 ↑ 1.0 1 1,788 / 4

Index Scan using matview_client_cache_tmp__idx__id on matview_client_cache matview_client_cache (cost=0.29..0.56 rows=1 width=12) (actual time=0.006..0.006 rows=1 loops=1,788)

  • Index Cond: (client.id = matview_client_cache.id)
  • Buffers: shared hit=5,329
55. 0.000 0.000 ↓ 0.0 0 1,788 / 4

Index Scan using matview_client_cache_tmp__idx__id on matview_client_cache parent_mcc (cost=0.29..0.56 rows=1 width=12) (actual time=0..0 rows=0 loops=1,788)

  • Index Cond: (client.parent_account_id = parent_mcc.id)
  • Buffers: shared hit=489
56. 0.003 0.016 ↑ 1.0 4 4 / 4

Hash (cost=1.04..1.04 rows=4 width=10) (actual time=0.016..0.016 rows=4 loops=4)

  • Buffers: shared hit=4
57. 0.013 0.013 ↑ 1.0 4 4 / 4

Seq Scan on client_segment client_segment (cost=0..1.04 rows=4 width=10) (actual time=0.013..0.013 rows=4 loops=4)

  • Buffers: shared hit=4
58. 0.447 0.447 ↓ 0.0 0 1,788 / 4

Index Scan using client_pkey on client parent_client (cost=0.42..0.72 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=1,788)

  • Index Cond: (client.parent_account_id = parent_client.id)
  • Buffers: shared hit=655
59. 0.002 0.005 ↑ 1.0 4 4 / 4

Hash (cost=1.04..1.04 rows=4 width=10) (actual time=0.005..0.005 rows=4 loops=4)

  • Buffers: shared hit=4
60. 0.003 0.003 ↑ 1.0 4 4 / 4

Seq Scan on client_segment parent_client_segment (cost=0..1.04 rows=4 width=10) (actual time=0.002..0.003 rows=4 loops=4)

  • Buffers: shared hit=4
61. 6.024 9.649 ↑ 2.4 28,132 4 / 4

Hash (cost=1,856.94..1,856.94 rows=66,194 width=28) (actual time=9.649..9.649 rows=28,132 loops=4)

  • Buffers: shared hit=1,195
62. 3.625 3.625 ↓ 1.7 112,529 1 / 4

Seq Scan on company company (cost=0..1,856.94 rows=66,194 width=28) (actual time=0.008..14.499 rows=112,529 loops=1)

  • Buffers: shared hit=1,195
63. 0.007 0.023 ↑ 1.0 30 4 / 4

Hash (cost=1.3..1.3 rows=30 width=15) (actual time=0.023..0.023 rows=30 loops=4)

  • Buffers: shared hit=4
64. 0.016 0.016 ↑ 1.0 30 4 / 4

Seq Scan on ticket_technology ticket_technology (cost=0..1.3 rows=30 width=15) (actual time=0.012..0.016 rows=30 loops=4)

  • Buffers: shared hit=4
65. 0.002 0.047 ↑ 1.0 1 4 / 4

Hash (cost=5.96..5.96 rows=1 width=21) (actual time=0.047..0.047 rows=1 loops=4)

  • Buffers: shared hit=16
66. 0.045 0.045 ↑ 1.0 1 4 / 4

Seq Scan on ticket_queue ticket_queue (cost=0..5.96 rows=1 width=21) (actual time=0.017..0.045 rows=1 loops=4)

  • Filter: (ticket_queue.id = 181)
  • Buffers: shared hit=16
67. 0.342 67.460 ↑ 24.8 1,711 1

Hash (cost=1,306,017.03..1,306,017.03 rows=42,415 width=8) (actual time=67.46..67.46 rows=1,711 loops=1)

  • Buffers: shared hit=54,402
68. 0.171 67.118 ↑ 24.8 1,711 1

Subquery Scan on last_mttr_entry_on (cost=1,305,380.81..1,306,017.03 rows=42,415 width=8) (actual time=65.548..67.118 rows=1,711 loops=1)

  • Buffers: shared hit=54,402
69. 0.839 66.947 ↑ 24.8 1,711 1

Unique (cost=1,305,380.81..1,305,592.88 rows=42,415 width=16) (actual time=65.546..66.947 rows=1,711 loops=1)

  • Buffers: shared hit=54,402
70. 4.920 66.108 ↑ 3.5 12,078 1

Sort (cost=1,305,380.81..1,305,486.84 rows=42,415 width=16) (actual time=65.545..66.108 rows=12,078 loops=1)

  • Sort Key: ticket_entry.ticket_id, ticket_entry.created_on DESC
  • Sort Method: quicksort Memory: 951kB
  • Buffers: shared hit=54,402
71. 18.201 61.188 ↑ 3.5 12,078 1

Gather (cost=1,492.74..1,302,120.73 rows=42,415 width=16) (actual time=7.006..61.188 rows=12,078 loops=1)

  • Workers Planned: 3
  • Workers Launched: 3
  • Buffers: shared hit=54,402
72. 2.812 42.987 ↑ 4.5 3,020 4 / 4

Hash Join (cost=492.74..1,296,879.23 rows=13,682 width=16) (actual time=0.451..42.987 rows=3,020 loops=4)

  • Filter: ((COALESCE(tes.keep_previous_mttr_trigger, 0) = 0) OR (ticket_entry.substatus_id = 1))
  • Buffers: shared hit=54,402
73. 5.790 40.103 ↑ 5.5 12,574 4 / 4

Nested Loop (cost=487.72..1,296,652.22 rows=68,656 width=20) (actual time=0.242..40.103 rows=12,574 loops=4)

  • Buffers: shared hit=54,262
74. 2.014 2.129 ↑ 16.5 447 4 / 4

Bitmap Heap Scan on ticket ticket (cost=487.29..66,627.74 rows=7,391 width=4) (actual time=0.197..2.129 rows=447 loops=4)

  • Heap Blocks: exact=980
  • Buffers: shared hit=1,658
75. 0.116 0.116 ↑ 12.8 1,788 1 / 4

Bitmap Index Scan on ticket_idx2 (cost=0..481.56 rows=22,913 width=0) (actual time=0.462..0.462 rows=1,788 loops=1)

  • Index Cond: ((ticket.status = 0) AND (ticket.ticket_queue_id = 181))
  • Buffers: shared hit=8
76. 32.184 32.184 ↑ 3.0 28 1,788 / 4

Index Scan using ticket_entry_idx on ticket_entry ticket_entry (cost=0.43..165.57 rows=85 width=20) (actual time=0.008..0.072 rows=28 loops=1,788)

  • Index Cond: (ticket_entry.ticket_id = ticket.id)
  • Buffers: shared hit=52,604
77. 0.028 0.072 ↑ 1.0 134 4 / 4

Hash (cost=3.34..3.34 rows=134 width=12) (actual time=0.072..0.072 rows=134 loops=4)

  • Buffers: shared hit=8
78. 0.044 0.044 ↑ 1.0 134 4 / 4

Seq Scan on ticket_entry_subject tes (cost=0..3.34 rows=134 width=12) (actual time=0.017..0.044 rows=134 loops=4)

  • Buffers: shared hit=8
79. 0.361 144.231 ↑ 72.7 1,743 1

Hash (cost=939,813.49..939,813.49 rows=126,699 width=8) (actual time=144.231..144.231 rows=1,743 loops=1)

  • Buffers: shared hit=30,740
80. 0.149 143.870 ↑ 72.7 1,743 1

Subquery Scan on initial_customer_notification (cost=921,084.38..939,813.49 rows=126,699 width=8) (actual time=137.674..143.87 rows=1,743 loops=1)

  • Buffers: shared hit=30,740
81. 0.300 143.721 ↑ 72.7 1,743 1

Aggregate (cost=921,084.38..938,546.5 rows=126,699 width=8) (actual time=137.673..143.721 rows=1,743 loops=1)

  • Buffers: shared hit=30,740
82. 20.692 143.421 ↑ 70.3 1,743 1

Gather Merge (cost=921,084.38..936,666.45 rows=122,613 width=8) (actual time=137.566..143.421 rows=1,743 loops=1)

  • Workers Planned: 3
  • Workers Launched: 3
  • Buffers: shared hit=56,484
83. 1.971 122.729 ↑ 93.7 436 4 / 4

Aggregate (cost=920,084.34..921,259.38 rows=40,871 width=8) (actual time=120.168..122.729 rows=436 loops=4)

  • Buffers: shared hit=56,484
84. 3.409 120.758 ↑ 3.3 12,510 4 / 4

Sort (cost=920,084.34..920,186.52 rows=40,871 width=16) (actual time=120.109..120.758 rows=12,510 loops=4)

  • Sort Key: ticket_entry_1.ticket_id
  • Sort Method: quicksort Memory: 2,000kB
  • Buffers: shared hit=56,484
85. 6.237 117.349 ↑ 3.3 12,510 4 / 4

Nested Loop (cost=15,812.94..916,953.87 rows=40,871 width=16) (actual time=76.125..117.349 rows=12,510 loops=4)

  • Buffers: shared hit=56,463
86. 56.408 77.995 ↑ 10.1 436 4 / 4

Bitmap Heap Scan on ticket ticket_1 (cost=15,812.51..58,838.7 rows=4,400 width=8) (actual time=76.07..77.995 rows=436 loops=4)

  • Heap Blocks: exact=833
  • Buffers: shared hit=4,240
87. 0.037 21.587 ↓ 0.0 0 1 / 4

BitmapAnd (cost=15,812.51..15,812.51 rows=13,640 width=0) (actual time=86.35..86.35 rows=0 loops=1)

  • Buffers: shared hit=2,628
88. 0.120 0.120 ↑ 12.8 1,788 1 / 4

Bitmap Index Scan on ticket_idx2 (cost=0..481.56 rows=22,913 width=0) (actual time=0.48..0.48 rows=1,788 loops=1)

  • Index Cond: ((ticket_1.status = 0) AND (ticket_1.ticket_queue_id = 181))
  • Buffers: shared hit=8
89. 21.430 21.430 ↑ 1.0 955,812 1 / 4

Bitmap Index Scan on ticket_category_idx (cost=0..15,323.88 rows=959,279 width=0) (actual time=85.72..85.72 rows=955,812 loops=1)

  • Index Cond: (ticket_1.category = ANY ('{0,6,11}'::integer[]))
  • Buffers: shared hit=2,620
90. 33.117 33.117 ↑ 2.9 29 1,743 / 4

Index Scan using ticket_entry_idx on ticket_entry ticket_entry_1 (cost=0.43..194.18 rows=85 width=12) (actual time=0.008..0.076 rows=29 loops=1,743)

  • Index Cond: (ticket_entry_1.ticket_id = ticket_1.id)
  • Buffers: shared hit=52,223
91. 0.231 0.441 ↑ 1.0 1,636 1

Hash (cost=30.36..30.36 rows=1,636 width=23) (actual time=0.441..0.441 rows=1,636 loops=1)

  • Buffers: shared hit=14
92. 0.210 0.210 ↑ 1.0 1,636 1

Seq Scan on ticket_subcategory subcategory (cost=0..30.36 rows=1,636 width=23) (actual time=0.011..0.21 rows=1,636 loops=1)

  • Buffers: shared hit=14
93. 0.016 0.032 ↑ 1.0 99 1

Hash (cost=1.99..1.99 rows=99 width=21) (actual time=0.031..0.032 rows=99 loops=1)

  • Buffers: shared hit=1
94. 0.016 0.016 ↑ 1.0 99 1

Seq Scan on ticket_category category (cost=0..1.99 rows=99 width=21) (actual time=0.006..0.016 rows=99 loops=1)

  • Buffers: shared hit=1
95. 5.364 5.364 ↑ 1.0 1 1,788

Index Scan using ticket_entry_pkey on ticket_entry entry (cost=0.43..7.56 rows=1 width=24) (actual time=0.003..0.003 rows=1 loops=1,788)

  • Index Cond: (entry.id = t.last_ticket_entry)
  • Buffers: shared hit=7,155
96. 3.576 3.576 ↑ 1.0 1 1,788

Index Scan using person_id_key on person updater (cost=0.42..0.44 rows=1 width=21) (actual time=0.002..0.002 rows=1 loops=1,788)

  • Index Cond: (updater.id = entry.created_by)
  • Buffers: shared hit=7,152
97. 0.019 0.043 ↑ 1.0 134 1

Hash (cost=3.34..3.34 rows=134 width=27) (actual time=0.043..0.043 rows=134 loops=1)

  • Buffers: shared hit=2
98. 0.024 0.024 ↑ 1.0 134 1

Seq Scan on ticket_entry_subject action_code (cost=0..3.34 rows=134 width=27) (actual time=0.007..0.024 rows=134 loops=1)

  • Buffers: shared hit=2
99. 0.006 0.015 ↑ 1.0 33 1

Hash (cost=1.33..1.33 rows=33 width=18) (actual time=0.015..0.015 rows=33 loops=1)

  • Buffers: shared hit=1
100. 0.009 0.009 ↑ 1.0 33 1

Seq Scan on ticket_substatus ticket_substatus (cost=0..1.33 rows=33 width=18) (actual time=0.005..0.009 rows=33 loops=1)

  • Buffers: shared hit=1
101. 7.936 7.936 ↑ 1.0 1 1,984

Index Scan using circuit_product_id_idx on circuit c (cost=0.43..0.55 rows=1 width=52) (actual time=0.004..0.004 rows=1 loops=1,984)

  • Index Cond: (c.product_id = ts.product_id)
  • Buffers: shared hit=7,771
102. 5.805 86.177 ↓ 241.6 48,318 1

Hash (cost=8,825.87..8,825.87 rows=200 width=12) (actual time=86.177..86.177 rows=48,318 loops=1)

  • Buffers: shared hit=948
103. 7.350 80.372 ↓ 241.6 48,319 1

Unique (cost=8,582.16..8,823.87 rows=200 width=12) (actual time=69.222..80.372 rows=48,319 loops=1)

  • Buffers: shared hit=948
104. 15.998 73.022 ↓ 1.0 48,537 1

Sort (cost=8,582.16..8,703.01 rows=48,342 width=12) (actual time=69.217..73.022 rows=48,537 loops=1)

  • Sort Key: related_gnid.related_gnid
  • Sort Method: quicksort Memory: 3,812kB
  • Buffers: shared hit=948
105. 21.091 57.024 ↓ 1.0 48,537 1

Aggregate (cost=3,854.07..4,337.49 rows=48,342 width=12) (actual time=48.922..57.024 rows=48,537 loops=1)

  • Buffers: shared hit=948
106. 3.278 35.933 ↓ 1.0 49,841 1

Append (cost=1,201.91..3,612.36 rows=48,342 width=12) (actual time=11.85..35.933 rows=49,841 loops=1)

  • Buffers: shared hit=948
107. 8.890 15.005 ↓ 1.0 24,573 1

Aggregate (cost=1,201.91..1,437.17 rows=23,526 width=12) (actual time=11.849..15.005 rows=24,573 loops=1)

  • Buffers: shared hit=474
108. 6.115 6.115 ↑ 1.0 25,829 1

Seq Scan on related_gnid related_gnid (cost=0..1,072.11 rows=25,959 width=4) (actual time=0.013..6.115 rows=25,829 loops=1)

  • Filter: ((related_gnid.relationship_type = 1) AND (related_gnid.status = 1))
  • Buffers: shared hit=474
109. 11.717 17.650 ↓ 1.0 25,268 1

Aggregate (cost=1,201.91..1,450.07 rows=24,816 width=12) (actual time=12.024..17.65 rows=25,268 loops=1)

  • Buffers: shared hit=474
110. 5.933 5.933 ↑ 1.0 25,829 1

Seq Scan on related_gnid related_gnid_1 (cost=0..1,072.11 rows=25,959 width=4) (actual time=0.011..5.933 rows=25,829 loops=1)

  • Filter: ((related_gnid_1.relationship_type = 1) AND (related_gnid_1.status = 1))
  • Buffers: shared hit=474
111. 0.045 0.117 ↑ 1.0 273 1

Hash (cost=7.73..7.73 rows=273 width=15) (actual time=0.117..0.117 rows=273 loops=1)

  • Buffers: shared hit=5
112. 0.072 0.072 ↑ 1.0 273 1

Seq Scan on circuit_type circuit_type (cost=0..7.73 rows=273 width=15) (actual time=0.034..0.072 rows=273 loops=1)

  • Buffers: shared hit=5
113. 0.007 0.020 ↑ 1.0 24 1

Hash (cost=1.24..1.24 rows=24 width=20) (actual time=0.02..0.02 rows=24 loops=1)

  • Buffers: shared hit=1
114. 0.013 0.013 ↑ 1.0 24 1

Seq Scan on circuit_status circuit_status (cost=0..1.24 rows=24 width=20) (actual time=0.01..0.013 rows=24 loops=1)

  • Buffers: shared hit=1
115. 75.871 146.076 ↑ 1.0 362,794 1

Hash (cost=13,588.94..13,588.94 rows=362,794 width=19) (actual time=146.076..146.076 rows=362,794 loops=1)

  • Buffers: shared hit=9,961
116. 70.205 70.205 ↑ 1.0 362,794 1

Seq Scan on person assignee (cost=0..13,588.94 rows=362,794 width=19) (actual time=0.017..70.205 rows=362,794 loops=1)

  • Buffers: shared hit=9,961
117. 2.387 70.875 ↑ 60.3 1,499 1

Aggregate (cost=1,331,799.77..1,333,381.56 rows=90,388 width=20) (actual time=67.349..70.875 rows=1,499 loops=1)

  • Buffers: shared hit=54,401
118. 3.004 68.488 ↑ 11.0 8,191 1

Sort (cost=1,331,799.77..1,332,025.74 rows=90,388 width=20) (actual time=67.333..68.488 rows=8,191 loops=1)

  • Sort Key: outage_inner.ticket_id
  • Sort Method: quicksort Memory: 832kB
  • Buffers: shared hit=54,401
119. 0.774 65.484 ↑ 11.0 8,191 1

Subquery Scan on outage_inner (cost=1,323,229.25..1,324,359.1 rows=90,388 width=20) (actual time=64.355..65.484 rows=8,191 loops=1)

  • Buffers: shared hit=54,401
120. 2.667 64.710 ↑ 11.0 8,191 1

Sort (cost=1,323,229.25..1,323,455.22 rows=90,388 width=32) (actual time=64.353..64.71 rows=8,191 loops=1)

  • Sort Key: ticket_entry_2.created_on
  • Sort Method: quicksort Memory: 832kB
  • Buffers: shared hit=54,401
121. 6.398 62.043 ↑ 11.0 8,191 1

WindowAgg (cost=1,312,173.06..1,315,788.58 rows=90,388 width=32) (actual time=55.26..62.043 rows=8,191 loops=1)

  • Buffers: shared hit=54,401
122. 3.231 55.645 ↑ 11.0 8,191 1

Sort (cost=1,312,173.06..1,312,399.03 rows=90,388 width=12) (actual time=55.226..55.645 rows=8,191 loops=1)

  • Sort Key: ticket_entry_2.ticket_id, ticket_entry_2.created_on
  • Sort Method: quicksort Memory: 576kB
  • Buffers: shared hit=54,401
123. 18.380 52.414 ↑ 11.0 8,191 1

Gather (cost=1,493.9..1,304,732.4 rows=90,388 width=12) (actual time=8.866..52.414 rows=8,191 loops=1)

  • Workers Planned: 3
  • Workers Launched: 3
  • Buffers: shared hit=54,401
124. 0.550 34.034 ↑ 14.2 2,048 4 / 4

Hash Join (cost=493.9..1,294,693.6 rows=29,157 width=12) (actual time=0.512..34.034 rows=2,048 loops=4)

  • Buffers: shared hit=54,401
125. 0.612 33.449 ↑ 14.2 2,048 4 / 4

Nested Loop (cost=492.16..1,294,605.66 rows=29,157 width=16) (actual time=0.328..33.449 rows=2,048 loops=4)

  • Buffers: shared hit=54,265
126. 1.870 1.994 ↑ 16.5 447 4 / 4

Bitmap Heap Scan on ticket ticket_2 (cost=491.72..66,632.18 rows=7,391 width=4) (actual time=0.214..1.994 rows=447 loops=4)

  • Heap Blocks: exact=1,023
  • Buffers: shared hit=1,661
127. 0.124 0.124 ↑ 12.8 1,788 1 / 4

Bitmap Index Scan on ticket_idx2 (cost=0..486 rows=22,913 width=0) (actual time=0.497..0.497 rows=1,788 loops=1)

  • Index Cond: ((ticket_2.status = ANY ('{0,3}'::integer[])) AND (ticket_2.ticket_queue_id = 181))
  • Buffers: shared hit=11
128. 30.843 30.843 ↑ 7.2 5 1,788 / 4

Index Scan using ticket_entry_idx on ticket_entry ticket_entry_2 (cost=0.43..165.78 rows=36 width=16) (actual time=0.029..0.069 rows=5 loops=1,788)

  • Index Cond: (ticket_entry_2.ticket_id = ticket_2.id)
  • Filter: (ticket_entry_2.substatus_id = ANY ('{0,13}'::integer[]))
  • Buffers: shared hit=52,604
129. 0.009 0.035 ↑ 1.0 33 4 / 4

Hash (cost=1.33..1.33 rows=33 width=4) (actual time=0.035..0.035 rows=33 loops=4)

  • Buffers: shared hit=4
130. 0.026 0.026 ↑ 1.0 33 4 / 4

Seq Scan on ticket_substatus ts_1 (cost=0..1.33 rows=33 width=4) (actual time=0.022..0.026 rows=33 loops=4)

  • Buffers: shared hit=4
131. 9.920 9.920 ↑ 1.0 1 1,984

Index Scan using so_pid_idx on service_order so (cost=0.43..0.63 rows=1 width=37) (actual time=0.005..0.005 rows=1 loops=1,984)

  • Index Cond: (so.product_id = ts.product_id)
  • Buffers: shared hit=7,773
132. 7.936 7.936 ↑ 1.0 1 1,984

Index Scan using client_site_pkey on client_site a_cs (cost=0.42..0.49 rows=1 width=11) (actual time=0.004..0.004 rows=1 loops=1,984)

  • Index Cond: (a_cs.id = so.a_site_id)
  • Buffers: shared hit=7,771
133. 1.984 1.984 ↑ 1.0 1 1,984

Index Scan using country_pkey on country a_site_country (cost=0.14..0.16 rows=1 width=15) (actual time=0.001..0.001 rows=1 loops=1,984)

  • Index Cond: (a_site_country.id = a_cs.country_id)
  • Buffers: shared hit=3,872
134. 1.984 1.984 ↓ 0.0 0 1,984

Index Scan using client_site_pkey on client_site z_cs (cost=0.42..0.49 rows=1 width=11) (actual time=0.001..0.001 rows=0 loops=1,984)

  • Index Cond: (z_cs.id = so.z_site_id)
  • Buffers: shared hit=1,599
135. 21.782 21.824 ↑ 1.0 250 1,984

Materialize (cost=0..7.75 rows=250 width=11) (actual time=0..0.011 rows=250 loops=1,984)

  • Buffers: shared hit=4
136. 0.042 0.042 ↑ 1.0 250 1

Seq Scan on country z_site_country (cost=0..6.5 rows=250 width=11) (actual time=0.013..0.042 rows=250 loops=1)

  • Buffers: shared hit=4
137. 90.605 90.620 ↑ 1.0 67 45,310

Materialize (cost=0..2 rows=67 width=13) (actual time=0..0.002 rows=67 loops=45,310)

  • Buffers: shared hit=1
138. 0.015 0.015 ↑ 1.0 67 1

Seq Scan on state a_cs_state (cost=0..1.67 rows=67 width=13) (actual time=0.009..0.015 rows=67 loops=1)

  • Buffers: shared hit=1
139. 135.921 135.930 ↑ 1.0 67 45,310

Materialize (cost=0..2 rows=67 width=13) (actual time=0..0.003 rows=67 loops=45,310)

  • Buffers: shared hit=1
140. 0.009 0.009 ↑ 1.0 67 1

Seq Scan on state z_cs_state (cost=0..1.67 rows=67 width=13) (actual time=0.003..0.009 rows=67 loops=1)

  • Buffers: shared hit=1
141. 90.620 90.620 ↑ 1.0 1 45,310

Index Scan using person_id_key on person pm (cost=0.42..0.47 rows=1 width=30) (actual time=0.002..0.002 rows=1 loops=45,310)

  • Index Cond: (so.gii_pm_id = pm.id)
  • Buffers: shared hit=181,056
Planning time : 44.59 ms
Execution time : 3,296.086 ms