explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LGv9 : with_gist

Settings
# exclusive inclusive rows x rows loops node
1. 0.013 28,148.356 ↑ 1.0 100 1

Limit (cost=156,741.78..165,263.96 rows=100 width=1,103) (actual time=28,147.815..28,148.356 rows=100 loops=1)

2. 0.011 28,148.343 ↑ 18.9 110 1

Append (cost=155,889.56..332,895.29 rows=2,077 width=1,103) (actual time=28,147.761..28,148.343 rows=110 loops=1)

3. 0.029 28,148.332 ↓ 110.0 110 1

Subquery Scan on *SELECT* 1 (cost=155,889.56..155,921.64 rows=1 width=1,103) (actual time=28,147.761..28,148.332 rows=110 loops=1)

4. 0.048 28,148.303 ↓ 110.0 110 1

Result (cost=155,889.56..155,921.63 rows=1 width=1,104) (actual time=28,147.760..28,148.303 rows=110 loops=1)

5. 1,243.826 28,147.815 ↓ 110.0 110 1

Sort (cost=155,889.56..155,889.57 rows=1 width=1,096) (actual time=28,147.714..28,147.815 rows=110 loops=1)

  • Sort Key: ((SubPlan 2)) DESC, offer.id DESC
  • Sort Method: external merge Disk: 121280kB
6. 224.757 26,903.989 ↓ 648,681.0 648,681 1

Nested Loop Semi Join (cost=1,028.46..155,889.55 rows=1 width=1,096) (actual time=3.414..26,903.989 rows=648,681 loops=1)

7. 195.758 15,651.655 ↓ 648,681.0 648,681 1

Nested Loop (cost=1,028.03..155,851.71 rows=1 width=1,095) (actual time=3.215..15,651.655 rows=648,681 loops=1)

8. 0.078 0.169 ↓ 16.0 16 1

Nested Loop (cost=0.00..2.35 rows=1 width=8) (actual time=0.015..0.169 rows=16 loops=1)

  • Join Filter: (venue."managingOffererId" = offerer.id)
  • Rows Removed by Join Filter: 134
9. 0.028 0.028 ↓ 21.0 21 1

Seq Scan on venue (cost=0.00..1.21 rows=1 width=16) (actual time=0.008..0.028 rows=21 loops=1)

  • Filter: ("validationToken" IS NULL)
10. 0.063 0.063 ↓ 7.0 7 21

Seq Scan on offerer (cost=0.00..1.13 rows=1 width=8) (actual time=0.002..0.003 rows=7 loops=21)

  • Filter: ("isActive" AND ("validationToken" IS NULL))
  • Rows Removed by Filter: 2
11. 15,422.752 15,455.728 ↓ 40,543.0 40,543 16

Bitmap Heap Scan on offer (cost=1,028.03..155,849.35 rows=1 width=1,095) (actual time=2.755..965.983 rows=40,543 loops=16)

  • Recheck Cond: ("venueId" = venue.id)
  • Filter: ("isActive" AND ((to_tsvector('french'::regconfig, (name)::text) @@ '''livr'''::tsquery) OR (to_tsvector('french'::regconfig, (("extraData" -> ''::text))::text) @@ '''livr'''::tsquery) OR (to_tsvector('french'::regconfig, (("extraData" -> ''::text))::text) @@ '''livr'''::tsquery) OR (to_tsvector('french'::regconfig, description) @@ '''livr'''::tsquery)) AND ((to_tsvector('french'::regconfig, (name)::text) @@ '''livr'''::tsquery) OR (to_tsvector('french'::regconfig, (("extraData" -> ''::text))::text) @@ '''livr'''::tsquery) OR (to_tsvector('french'::regconfig, (("extraData" -> ''::text))::text) @@ '''livr'''::tsquery) OR (to_tsvector('french'::regconfig, description) @@ '''livr'''::tsquery)) AND ((to_tsvector('french'::regconfig, (name)::text) @@ '''livr'''::tsquery) OR (to_tsvector('french'::regconfig, (("extraData" -> ''::text))::text) @@ '''livr'''::tsquery) OR (to_tsvector('french'::regconfig, (("extraData" -> ''::text))::text) @@ '''livr'''::tsquery) OR (to_tsvector('french'::regconfig, description) @@ '''livr'''::tsquery)))
  • Rows Removed by Filter: 5
  • Heap Blocks: exact=72963
12. 32.976 32.976 ↓ 1.0 40,548 16

Bitmap Index Scan on "ix_offer_venueId" (cost=0.00..1,028.03 rows=40,481 width=0) (actual time=2.061..2.061 rows=40,548 loops=16)

  • Index Cond: ("venueId" = venue.id)
13. 1,946.043 3,243.405 ↑ 1.0 1 648,681

Index Scan using "ix_stock_offerId" on stock (cost=0.42..16.91 rows=1 width=8) (actual time=0.005..0.005 rows=1 loops=648,681)

  • Index Cond: ("offerId" = offer.id)
  • Filter: ((NOT "isSoftDeleted") AND (("bookingLimitDatetime" > '2019-11-07 00:00:00'::timestamp without time zone) OR ("bookingLimitDatetime" IS NULL)) AND ((("beginningDatetime" IS NOT NULL) AND ("beginningDatetime" > '2019-11-07 00:00:00'::timestamp without time zone)) OR ("beginningDatetime" IS NULL)) AND ((available IS NULL) OR ((SubPlan 3) > 1)))
14.          

SubPlan (forIndex Scan)

15. 0.000 1,297.362 ↑ 1.0 1 648,681

Aggregate (cost=8.45..8.46 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=648,681)

16. 1,297.362 1,297.362 ↑ 1.0 1 648,681

Index Scan using "ix_booking_stockId" on booking (cost=0.42..8.45 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=648,681)

  • Index Cond: ("stockId" = stock.id)
  • Filter: (((NOT "isUsed") AND (NOT "isCancelled")) OR ("isUsed" AND ("dateUsed" > stock."dateModified")))
17.          

SubPlan (forNested Loop Semi Join)

18. 7,135.492 7,784.172 ↑ 1.0 1 648,681

Result (cost=0.42..4.44 rows=1 width=0) (actual time=0.012..0.012 rows=1 loops=648,681)

  • One-Time Filter: ((offer.name)::text @@ plainto_tsquery('livre'::text))
19. 648.680 648.680 ↑ 1.0 1 648,680

Index Only Scan using offer_pkey on offer offer_1_1 (cost=0.42..4.44 rows=1 width=0) (actual time=0.001..0.001 rows=1 loops=648,680)

  • Index Cond: (id = offer.id)
  • Heap Fetches: 0
20.          

SubPlan (forResult)

21. 0.110 0.440 ↑ 1.0 1 110

Aggregate (cost=27.60..27.61 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=110)

22. 0.207 0.330 ↓ 0.0 0 110

Hash Join (cost=14.47..27.58 rows=8 width=4) (actual time=0.003..0.003 rows=0 loops=110)

  • Hash Cond: (criterion.id = offer_criterion."criterionId")
23. 0.013 0.013 ↑ 220.0 1 1

Seq Scan on criterion (cost=0.00..12.20 rows=220 width=12) (actual time=0.013..0.013 rows=1 loops=1)

24. 0.000 0.110 ↓ 0.0 0 110

Hash (cost=14.37..14.37 rows=8 width=8) (actual time=0.001..0.001 rows=0 loops=110)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
25. 0.110 0.110 ↓ 0.0 0 110

Bitmap Heap Scan on offer_criterion (cost=4.21..14.37 rows=8 width=8) (actual time=0.001..0.001 rows=0 loops=110)

  • Recheck Cond: ("offerId" = offer.id)
26. 0.000 0.000 ↓ 0.0 0 110

Bitmap Index Scan on "ix_offer_criterion_offerId" (cost=0.00..4.21 rows=8 width=0) (actual time=0.000..0.000 rows=0 loops=110)

  • Index Cond: ("offerId" = offer.id)
27. 0.000 0.000 ↓ 0.0 0

Nested Loop Semi Join (cost=1,038.71..88,477.16 rows=1,038 width=1,103) (never executed)

28. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1,038.29..31,798.28 rows=3,114 width=1,095) (never executed)

29. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.14..13.08 rows=1 width=8) (never executed)

  • Join Filter: (venue_1."managingOffererId" = offerer_1.id)
30. 0.000 0.000 ↓ 0.0 0

Index Scan using "venue_validationToken_key" on venue venue_1 (cost=0.14..11.94 rows=1 width=16) (never executed)

  • Index Cond: ("validationToken" IS NULL)
  • Filter: (((to_tsvector('french'::regconfig, (name)::text) @@ '''livr'''::tsquery) OR (to_tsvector('french'::regconfig, ("publicName")::text) @@ '''livr'''::tsquery) OR (to_tsvector('french'::regconfig, (address)::text) @@ '''livr'''::tsquery) OR (to_tsvector('french'::regconfig, (siret)::text) @@ '''livr'''::tsquery) OR (to_tsvector('french'::regconfig, (city)::text) @@ '''livr'''::tsquery)) AND ((to_tsvector('french'::regconfig, (name)::text) @@ '''livr'''::tsquery) OR (to_tsvector('french'::regconfig, ("publicName")::text) @@ '''livr'''::tsquery) OR (to_tsvector('french'::regconfig, (address)::text) @@ '''livr'''::tsquery) OR (to_tsvector('french'::regconfig, (siret)::text) @@ '''livr'''::tsquery) OR (to_tsvector('french'::regconfig, (city)::text) @@ '''livr'''::tsquery)) AND ((to_tsvector('french'::regconfig, (name)::text) @@ '''livr'''::tsquery) OR (to_tsvector('french'::regconfig, ("publicName")::text) @@ '''livr'''::tsquery) OR (to_tsvector('french'::regconfig, (address)::text) @@ '''livr'''::tsquery) OR (to_tsvector('french'::regconfig, (siret)::text) @@ '''livr'''::tsquery) OR (to_tsvector('french'::regconfig, (city)::text) @@ '''livr'''::tsquery)))
31. 0.000 0.000 ↓ 0.0 0

Seq Scan on offerer offerer_1 (cost=0.00..1.13 rows=1 width=8) (never executed)

  • Filter: ("isActive" AND ("validationToken" IS NULL))
32. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on offer offer_1 (cost=1,038.15..31,380.39 rows=40,480 width=1,095) (never executed)

  • Recheck Cond: ("venueId" = venue_1.id)
  • Filter: "isActive
33. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on "ix_offer_venueId" (cost=0.00..1,028.03 rows=40,481 width=0) (never executed)

  • Index Cond: ("venueId" = venue_1.id)
34. 0.000 0.000 ↓ 0.0 0

Index Scan using "ix_stock_offerId" on stock stock_1 (cost=0.42..9.00 rows=1 width=8) (never executed)

  • Index Cond: ("offerId" = offer_1.id)
  • Filter: ((NOT "isSoftDeleted") AND (("bookingLimitDatetime" > '2019-11-07 00:00:00'::timestamp without time zone) OR ("bookingLimitDatetime" IS NULL)) AND ((("beginningDatetime" IS NOT NULL) AND ("beginningDatetime" > '2019-11-07 00:00:00'::timestamp without time zone)) OR ("beginningDatetime" IS NULL)) AND ((available IS NULL) OR ((SubPlan 5) > 1)))
35.          

SubPlan (forIndex Scan)

36. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=8.45..8.46 rows=1 width=8) (never executed)

37. 0.000 0.000 ↓ 0.0 0

Index Scan using "ix_booking_stockId" on booking booking_1 (cost=0.42..8.45 rows=1 width=4) (never executed)

  • Index Cond: ("stockId" = stock_1.id)
  • Filter: (((NOT "isUsed") AND (NOT "isCancelled")) OR ("isUsed" AND ("dateUsed" > stock_1."dateModified")))
38.          

SubPlan (forNested Loop Semi Join)

39. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=27.60..27.61 rows=1 width=8) (never executed)

40. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=14.47..27.58 rows=8 width=4) (never executed)

  • Hash Cond: (criterion_1.id = offer_criterion_1."criterionId")
41. 0.000 0.000 ↓ 0.0 0

Seq Scan on criterion criterion_1 (cost=0.00..12.20 rows=220 width=12) (never executed)

42. 0.000 0.000 ↓ 0.0 0

Hash (cost=14.37..14.37 rows=8 width=8) (never executed)

43. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on offer_criterion offer_criterion_1 (cost=4.21..14.37 rows=8 width=8) (never executed)

  • Recheck Cond: ("offerId" = offer_1.id)
44. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on "ix_offer_criterion_offerId" (cost=0.00..4.21 rows=8 width=0) (never executed)

  • Index Cond: ("offerId" = offer_1.id)
45. 0.000 0.000 ↓ 0.0 0

Nested Loop Semi Join (cost=1,038.71..88,475.73 rows=1,038 width=1,103) (never executed)

46. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1,038.29..31,796.84 rows=3,114 width=1,095) (never executed)

47. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.14..11.65 rows=1 width=8) (never executed)

  • Join Filter: (venue_2."managingOffererId" = offerer_2.id)
48. 0.000 0.000 ↓ 0.0 0

Seq Scan on venue venue_2 (cost=0.00..1.21 rows=1 width=16) (never executed)

  • Filter: ("validationToken" IS NULL)
49. 0.000 0.000 ↓ 0.0 0

Index Scan using "offerer_validationToken_key" on offerer offerer_2 (cost=0.14..10.42 rows=1 width=8) (never executed)

  • Index Cond: ("validationToken" IS NULL)
  • Filter: ("isActive" AND ((to_tsvector('french'::regconfig, (name)::text) @@ '''livr'''::tsquery) OR (to_tsvector('french'::regconfig, (address)::text) @@ '''livr'''::tsquery) OR (to_tsvector('french'::regconfig, (siren)::text) @@ '''livr'''::tsquery)) AND ((to_tsvector('french'::regconfig, (name)::text) @@ '''livr'''::tsquery) OR (to_tsvector('french'::regconfig, (address)::text) @@ '''livr'''::tsquery) OR (to_tsvector('french'::regconfig, (siren)::text) @@ '''livr'''::tsquery)) AND ((to_tsvector('french'::regconfig, (name)::text) @@ '''livr'''::tsquery) OR (to_tsvector('french'::regconfig, (address)::text) @@ '''livr'''::tsquery) OR (to_tsvector('french'::regconfig, (siren)::text) @@ '''livr'''::tsquery)))
50. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on offer offer_2 (cost=1,038.15..31,380.39 rows=40,480 width=1,095) (never executed)

  • Recheck Cond: ("venueId" = venue_2.id)
  • Filter: "isActive
51. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on "ix_offer_venueId" (cost=0.00..1,028.03 rows=40,481 width=0) (never executed)

  • Index Cond: ("venueId" = venue_2.id)
52. 0.000 0.000 ↓ 0.0 0

Index Scan using "ix_stock_offerId" on stock stock_2 (cost=0.42..9.00 rows=1 width=8) (never executed)

  • Index Cond: ("offerId" = offer_2.id)
  • Filter: ((NOT "isSoftDeleted") AND (("bookingLimitDatetime" > '2018-11-07 00:00:00'::timestamp without time zone) OR ("bookingLimitDatetime" IS NULL)) AND ((("beginningDatetime" IS NOT NULL) AND ("beginningDatetime" > '2019-11-07 00:00:00'::timestamp without time zone)) OR ("beginningDatetime" IS NULL)) AND ((available IS NULL) OR ((SubPlan 7) > 1)))
53.          

SubPlan (forIndex Scan)

54. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=8.45..8.46 rows=1 width=8) (never executed)

55. 0.000 0.000 ↓ 0.0 0

Index Scan using "ix_booking_stockId" on booking booking_2 (cost=0.42..8.45 rows=1 width=4) (never executed)

  • Index Cond: ("stockId" = stock_2.id)
  • Filter: (((NOT "isUsed") AND (NOT "isCancelled")) OR ("isUsed" AND ("dateUsed" > stock_2."dateModified")))
56.          

SubPlan (forNested Loop Semi Join)

57. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=27.60..27.61 rows=1 width=8) (never executed)

58. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=14.47..27.58 rows=8 width=4) (never executed)

  • Hash Cond: (criterion_2.id = offer_criterion_2."criterionId")
59. 0.000 0.000 ↓ 0.0 0

Seq Scan on criterion criterion_2 (cost=0.00..12.20 rows=220 width=12) (never executed)

60. 0.000 0.000 ↓ 0.0 0

Hash (cost=14.37..14.37 rows=8 width=8) (never executed)

61. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on offer_criterion offer_criterion_2 (cost=4.21..14.37 rows=8 width=8) (never executed)

  • Recheck Cond: ("offerId" = offer_2.id)
62. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on "ix_offer_criterion_offerId" (cost=0.00..4.21 rows=8 width=0) (never executed)

  • Index Cond: ("offerId" = offer_2.id)
Planning time : 6.163 ms
Execution time : 28,166.324 ms