explain.depesz.com

PostgreSQL's explain analyze made readable

Result: V7bf

Settings
# exclusive inclusive rows x rows loops node
1. 0.012 28,239.487 ↑ 1.0 100 1

Limit (cost=158,468.87..184,122.18 rows=100 width=1,103) (actual time=28,238.920..28,239.487 rows=100 loops=1)

2. 0.011 28,239.475 ↑ 2.9 110 1

Append (cost=155,903.54..236,711.47 rows=315 width=1,103) (actual time=28,238.867..28,239.475 rows=110 loops=1)

3. 0.031 28,239.464 ↓ 110.0 110 1

Subquery Scan on *SELECT* 1 (cost=155,903.54..155,935.61 rows=1 width=1,103) (actual time=28,238.867..28,239.464 rows=110 loops=1)

4. 0.111 28,239.433 ↓ 110.0 110 1

Result (cost=155,903.54..155,935.60 rows=1 width=1,104) (actual time=28,238.866..28,239.433 rows=110 loops=1)

5. 1,222.717 28,238.882 ↓ 110.0 110 1

Sort (cost=155,903.54..155,903.54 rows=1 width=1,096) (actual time=28,238.820..28,238.882 rows=110 loops=1)

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

Nested Loop Semi Join (cost=1,028.74..155,903.53 rows=1 width=1,096) (actual time=4.600..27,016.165 rows=648,681 loops=1)

7. 196.528 15,712.878 ↓ 648,681.0 648,681 1

Nested Loop (cost=1,028.31..155,865.68 rows=1 width=1,095) (actual time=4.362..15,712.878 rows=648,681 loops=1)

8. 0.035 0.222 ↓ 16.0 16 1

Nested Loop (cost=0.28..16.32 rows=1 width=8) (actual time=0.038..0.222 rows=16 loops=1)

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

Index Scan using "venue_validationToken_key" on venue (cost=0.14..8.15 rows=1 width=16) (actual time=0.021..0.040 rows=21 loops=1)

  • Index Cond: ("validationToken" IS NULL)
10. 0.147 0.147 ↓ 6.0 6 21

Index Scan using "offerer_validationToken_key" on offerer (cost=0.14..8.16 rows=1 width=8) (actual time=0.006..0.007 rows=6 loops=21)

  • Index Cond: ("validationToken" IS NULL)
  • Filter: "isActive
11. 15,481.616 15,516.128 ↓ 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.888..969.758 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. 34.512 34.512 ↓ 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.157..2.157 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 (for Index 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 (for Nested 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 (for Result)

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.85..40,387.12 rows=157 width=1,103) (never executed)

28. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1,038.43..31,805.31 rows=472 width=1,095) (never executed)

29. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..20.11 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

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

  • Index Cond: ("validationToken" IS NULL)
  • Filter: "isActive
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 (for Index 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 (for Nested 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.85..40,385.60 rows=157 width=1,103) (never executed)

46. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1,038.43..31,803.79 rows=472 width=1,095) (never executed)

47. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..18.60 rows=1 width=8) (never executed)

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

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

  • Index Cond: ("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.43 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 (for Index 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 (for Nested 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 : 11.855 ms
Execution time : 28,256.626 ms