explain.depesz.com

PostgreSQL's explain analyze made readable

Result: KdF3

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Hash Join (cost=55,206.96..183,916.51 rows=244 width=1,060) (actual rows= loops=)

  • Hash Cond: (CASE WHEN t1_1.is_periodical THEN t1_1.parent_id ELSE t1_1.id END = t1.id)
2. 0.000 0.000 ↓ 0.0

HashAggregate (cost=48,014.32..48,024.06 rows=974 width=9) (actual rows= loops=)

  • Group Key: CASE WHEN t1_1.is_periodical THEN t1_1.parent_id ELSE t1_1.id END
3. 0.000 0.000 ↓ 0.0

Seq Scan on event t1_1 (cost=0.00..48,011.88 rows=974 width=9) (actual rows= loops=)

  • Filter: (SubPlan 2)
4.          

SubPlan (forSeq Scan)

5. 0.000 0.000 ↓ 0.0

Result (cost=4.43..44.71 rows=27 width=4) (actual rows= loops=)

  • One-Time Filter: (NOT t1_1.is_periodical)
6. 0.000 0.000 ↓ 0.0

Hash Join (cost=4.43..44.71 rows=27 width=4) (actual rows= loops=)

  • Hash Cond: (t8_4.create_by_id = t10_4.id)
7. 0.000 0.000 ↓ 0.0

Seq Scan on announcement t8_4 (cost=0.00..36.15 rows=1,515 width=8) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Hash (cost=4.40..4.40 rows=2 width=4) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Seq Scan on authuser t10_4 (cost=0.00..4.40 rows=2 width=4) (actual rows= loops=)

  • Filter: (company_id = 23)
10. 0.000 0.000 ↓ 0.0

Hash (cost=7,186.55..7,186.55 rows=487 width=1,048) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=7,110.21..7,186.55 rows=487 width=1,048) (actual rows= loops=)

  • Hash Cond: (t1.parent_id = t6.id)
12. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=7,024.36..7,099.42 rows=487 width=997) (actual rows= loops=)

  • Hash Cond: (t1.event_type_id = t5.id)
13. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=7,023.04..7,096.44 rows=487 width=879) (actual rows= loops=)

  • Hash Cond: (t1.event_category_id = t4.id)
14. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=7,021.57..7,093.43 rows=487 width=761) (actual rows= loops=)

  • Hash Cond: (t1.hall_layout_id = t3.id)
15. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=7,015.88..7,086.44 rows=487 width=734) (actual rows= loops=)

  • Hash Cond: (t1.place_id = t2.id)
16. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=7,012.91..7,082.09 rows=487 width=186) (actual rows= loops=)

  • Hash Cond: (t1.id = t8_2.event_id)
  • Filter: CASE WHEN (NOT t1.is_periodical) THEN ((count(t7_1.id)) > 0) ELSE true END
17. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=5,177.69..5,244.31 rows=974 width=178) (actual rows= loops=)

  • Hash Cond: (t1.id = children.parent_id)
  • Filter: CASE WHEN t1.is_periodical THEN (children.children IS NOT NULL) ELSE true END
18. 0.000 0.000 ↓ 0.0

Seq Scan on event t1 (cost=0.00..61.49 rows=1,949 width=146) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Hash (cost=5,177.68..5,177.68 rows=1 width=36) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Subquery Scan on children (cost=5,177.60..5,177.68 rows=1 width=36) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=5,177.60..5,177.67 rows=1 width=36) (actual rows= loops=)

  • Group Key: t.parent_id
22. 0.000 0.000 ↓ 0.0

Sort (cost=5,177.60..5,177.61 rows=6 width=60) (actual rows= loops=)

  • Sort Key: t.parent_id
23. 0.000 0.000 ↓ 0.0

Subquery Scan on t (cost=5,177.44..5,177.52 rows=6 width=60) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Sort (cost=5,177.44..5,177.46 rows=6 width=56) (actual rows= loops=)

  • Sort Key: (((((t11.date_finish)::text || ' '::text) || (t11.time_finish)::text))::timestamp without time zone)
25. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,904.37..5,177.37 rows=6 width=56) (actual rows= loops=)

  • Hash Cond: (t11.id = t8_1.event_id)
26. 0.000 0.000 ↓ 0.0

Nested Loop (cost=52.47..160.64 rows=39 width=36) (actual rows= loops=)

27. 0.000 0.000 ↓ 0.0

HashAggregate (cost=52.19..53.36 rows=117 width=4) (actual rows= loops=)

  • Group Key: t8.event_id
28. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=7.06..51.90 rows=117 width=4) (actual rows= loops=)

  • Hash Cond: (t10.company_id = t12.id)
  • Filter: ((t8.create_by_id = 160) OR (t12.id = 23))
29. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=5.52..45.80 rows=1,515 width=12) (actual rows= loops=)

  • Hash Cond: (t8.create_by_id = t10.id)
30. 0.000 0.000 ↓ 0.0

Seq Scan on announcement t8 (cost=0.00..36.15 rows=1,515 width=8) (actual rows= loops=)

31. 0.000 0.000 ↓ 0.0

Hash (cost=4.12..4.12 rows=112 width=8) (actual rows= loops=)

32. 0.000 0.000 ↓ 0.0

Seq Scan on authuser t10 (cost=0.00..4.12 rows=112 width=8) (actual rows= loops=)

33. 0.000 0.000 ↓ 0.0

Hash (cost=1.24..1.24 rows=24 width=4) (actual rows= loops=)

34. 0.000 0.000 ↓ 0.0

Seq Scan on company t12 (cost=0.00..1.24 rows=24 width=4) (actual rows= loops=)

35. 0.000 0.000 ↓ 0.0

Index Scan using event_pkey on event t11 (cost=0.28..0.94 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (id = t8.event_id)
  • Filter: (((((date_finish)::text || ' '::text) || (time_finish)::text))::timestamp without time zone >= '2019-09-05 13:31:14.738254'::timestamp without time zone)
36. 0.000 0.000 ↓ 0.0

Hash (cost=1,847.92..1,847.92 rows=319 width=12) (actual rows= loops=)

37. 0.000 0.000 ↓ 0.0

HashAggregate (cost=1,841.54..1,844.73 rows=319 width=12) (actual rows= loops=)

  • Group Key: t8_1.event_id
  • Filter: (count(t7.id) > 0)
38. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5.27..1,823.69 rows=2,380 width=8) (actual rows= loops=)

39. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4.85..382.01 rows=2,948 width=8) (actual rows= loops=)

40. 0.000 0.000 ↓ 0.0

Hash Join (cost=4.43..44.71 rows=27 width=8) (actual rows= loops=)

  • Hash Cond: (t8_1.create_by_id = t10_1.id)
41. 0.000 0.000 ↓ 0.0

Seq Scan on announcement t8_1 (cost=0.00..36.15 rows=1,515 width=12) (actual rows= loops=)

42. 0.000 0.000 ↓ 0.0

Hash (cost=4.40..4.40 rows=2 width=4) (actual rows= loops=)

43. 0.000 0.000 ↓ 0.0

Seq Scan on authuser t10_1 (cost=0.00..4.40 rows=2 width=4) (actual rows= loops=)

  • Filter: (company_id = 23)
44. 0.000 0.000 ↓ 0.0

Index Scan using ticket_announcement_id on ticket t7 (cost=0.42..10.65 rows=184 width=8) (actual rows= loops=)

  • Index Cond: (announcement_id = t8_1.id)
45. 0.000 0.000 ↓ 0.0

Index Scan using ticketstatus_ticket_id on ticketstatus t9 (cost=0.42..0.48 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (ticket_id = t7.id)
  • Filter: (status = ANY ('{1,999,4,2}'::integer[]))
46.          

SubPlan (forHash Join)

47. 0.000 0.000 ↓ 0.0

Aggregate (cost=527.42..527.43 rows=1 width=8) (actual rows= loops=)

48. 0.000 0.000 ↓ 0.0

Nested Loop (cost=10.58..527.42 rows=1 width=4) (actual rows= loops=)

49. 0.000 0.000 ↓ 0.0

Nested Loop (cost=10.16..522.56 rows=10 width=4) (actual rows= loops=)

50. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4.32..21.61 rows=1 width=4) (actual rows= loops=)

  • Join Filter: (t8_5.create_by_id = t10_5.id)
51. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on announcement t8_5 (cost=4.32..17.06 rows=5 width=8) (actual rows= loops=)

  • Recheck Cond: (event_id = t11.id)
52. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on announcement_event_id (cost=0.00..4.31 rows=5 width=0) (actual rows= loops=)

  • Index Cond: (event_id = t11.id)
53. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..4.41 rows=2 width=4) (actual rows= loops=)

54. 0.000 0.000 ↓ 0.0

Seq Scan on authuser t10_5 (cost=0.00..4.40 rows=2 width=4) (actual rows= loops=)

  • Filter: (company_id = 23)
55. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on ticket t7_3 (cost=5.85..499.10 rows=184 width=8) (actual rows= loops=)

  • Recheck Cond: (announcement_id = t8_5.id)
56. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on ticket_announcement_id (cost=0.00..5.80 rows=184 width=0) (actual rows= loops=)

  • Index Cond: (announcement_id = t8_5.id)
57. 0.000 0.000 ↓ 0.0

Index Scan using ticketstatus_ticket_id on ticketstatus t9_3 (cost=0.42..0.48 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (ticket_id = t7_3.id)
  • Filter: (status = 1)
58. 0.000 0.000 ↓ 0.0

Hash (cost=1,832.78..1,832.78 rows=195 width=12) (actual rows= loops=)

59. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=1,827.42..1,830.83 rows=195 width=12) (actual rows= loops=)

  • Group Key: t8_2.event_id
60. 0.000 0.000 ↓ 0.0

Sort (cost=1,827.42..1,827.90 rows=195 width=8) (actual rows= loops=)

  • Sort Key: t8_2.event_id
61. 0.000 0.000 ↓ 0.0

Nested Loop (cost=5.27..1,820.00 rows=195 width=8) (actual rows= loops=)

62. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4.85..382.01 rows=2,948 width=8) (actual rows= loops=)

63. 0.000 0.000 ↓ 0.0

Hash Join (cost=4.43..44.71 rows=27 width=8) (actual rows= loops=)

  • Hash Cond: (t8_2.create_by_id = t10_2.id)
64. 0.000 0.000 ↓ 0.0

Seq Scan on announcement t8_2 (cost=0.00..36.15 rows=1,515 width=12) (actual rows= loops=)

65. 0.000 0.000 ↓ 0.0

Hash (cost=4.40..4.40 rows=2 width=4) (actual rows= loops=)

66. 0.000 0.000 ↓ 0.0

Seq Scan on authuser t10_2 (cost=0.00..4.40 rows=2 width=4) (actual rows= loops=)

  • Filter: (company_id = 23)
67. 0.000 0.000 ↓ 0.0

Index Scan using ticket_announcement_id on ticket t7_1 (cost=0.42..10.65 rows=184 width=8) (actual rows= loops=)

  • Index Cond: (announcement_id = t8_2.id)
68. 0.000 0.000 ↓ 0.0

Index Scan using ticketstatus_ticket_id on ticketstatus t9_1 (cost=0.42..0.48 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (ticket_id = t7_1.id)
  • Filter: (status = ANY ('{1,999,4}'::integer[]))
69. 0.000 0.000 ↓ 0.0

Hash (cost=2.43..2.43 rows=43 width=552) (actual rows= loops=)

70. 0.000 0.000 ↓ 0.0

Seq Scan on place t2 (cost=0.00..2.43 rows=43 width=552) (actual rows= loops=)

71. 0.000 0.000 ↓ 0.0

Hash (cost=3.64..3.64 rows=164 width=31) (actual rows= loops=)

72. 0.000 0.000 ↓ 0.0

Seq Scan on halllayout t3 (cost=0.00..3.64 rows=164 width=31) (actual rows= loops=)

73. 0.000 0.000 ↓ 0.0

Hash (cost=1.21..1.21 rows=21 width=122) (actual rows= loops=)

74. 0.000 0.000 ↓ 0.0

Seq Scan on eventcategory t4 (cost=0.00..1.21 rows=21 width=122) (actual rows= loops=)

75. 0.000 0.000 ↓ 0.0

Hash (cost=1.14..1.14 rows=14 width=122) (actual rows= loops=)

76. 0.000 0.000 ↓ 0.0

Seq Scan on eventtype t5 (cost=0.00..1.14 rows=14 width=122) (actual rows= loops=)

77. 0.000 0.000 ↓ 0.0

Hash (cost=61.49..61.49 rows=1,949 width=55) (actual rows= loops=)

78. 0.000 0.000 ↓ 0.0

Seq Scan on event t6 (cost=0.00..61.49 rows=1,949 width=55) (actual rows= loops=)

79.          

SubPlan (forHash Join)

80. 0.000 0.000 ↓ 0.0

Aggregate (cost=527.42..527.43 rows=1 width=8) (actual rows= loops=)

81. 0.000 0.000 ↓ 0.0

Nested Loop (cost=10.58..527.42 rows=1 width=4) (actual rows= loops=)

82. 0.000 0.000 ↓ 0.0

Nested Loop (cost=10.16..522.56 rows=10 width=4) (actual rows= loops=)

83. 0.000 0.000 ↓ 0.0

Nested Loop (cost=4.32..21.61 rows=1 width=4) (actual rows= loops=)

  • Join Filter: (t8_3.create_by_id = t10_3.id)
84. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on announcement t8_3 (cost=4.32..17.06 rows=5 width=8) (actual rows= loops=)

  • Recheck Cond: (event_id = t1.id)
85. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on announcement_event_id (cost=0.00..4.31 rows=5 width=0) (actual rows= loops=)

  • Index Cond: (event_id = t1.id)
86. 0.000 0.000 ↓ 0.0

Materialize (cost=0.00..4.41 rows=2 width=4) (actual rows= loops=)

87. 0.000 0.000 ↓ 0.0

Seq Scan on authuser t10_3 (cost=0.00..4.40 rows=2 width=4) (actual rows= loops=)

  • Filter: (company_id = 23)
88. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on ticket t7_2 (cost=5.85..499.10 rows=184 width=8) (actual rows= loops=)

  • Recheck Cond: (announcement_id = t8_3.id)
89. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on ticket_announcement_id (cost=0.00..5.80 rows=184 width=0) (actual rows= loops=)

  • Index Cond: (announcement_id = t8_3.id)
90. 0.000 0.000 ↓ 0.0

Index Scan using ticketstatus_ticket_id on ticketstatus t9_2 (cost=0.42..0.48 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (ticket_id = t7_2.id)
  • Filter: (status = 1)