explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mgqL

Settings
# exclusive inclusive rows x rows loops node
1. 0.092 40.775 ↑ 1.0 26 1

Limit (cost=28,465.23..28,465.29 rows=26 width=1,987) (actual time=40.681..40.775 rows=26 loops=1)

2. 0.175 40.683 ↑ 87.0 26 1

Sort (cost=28,465.23..28,470.88 rows=2,261 width=1,987) (actual time=40.681..40.683 rows=26 loops=1)

  • Sort Key: e0."offSaleDate", e0.id DESC
  • Sort Method: top-N heapsort Memory: 127kB
3. 0.060 40.508 ↑ 33.7 67 1

Group (cost=8,704.22..28,400.79 rows=2,261 width=1,987) (actual time=26.765..40.508 rows=67 loops=1)

  • Group Key: e0.id
4. 0.000 40.448 ↑ 33.7 67 1

Gather Merge (cost=8,704.22..28,395.13 rows=2,261 width=1,987) (actual time=26.752..40.448 rows=67 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
5. 0.436 51.992 ↑ 66.5 34 2

Group (cost=7,704.21..27,140.76 rows=2,261 width=1,987) (actual time=19.197..25.996 rows=34 loops=2)

  • Group Key: e0.id
6. 3.462 51.556 ↑ 2.1 1,506 2

Nested Loop (cost=7,704.21..27,132.91 rows=3,139 width=1,987) (actual time=19.193..25.778 rows=1,506 loops=2)

7. 0.967 42.036 ↑ 2.1 1,514 2

Nested Loop Left Join (cost=7,702.21..8,217.51 rows=3,136 width=2,003) (actual time=19.171..21.018 rows=1,514 loops=2)

8. 1.446 40.022 ↑ 10.5 174 2

Merge Left Join (cost=7,702.06..7,852.83 rows=1,819 width=1,999) (actual time=19.125..20.011 rows=174 loops=2)

  • Merge Cond: (e0.id = e1."EventId")
9. 0.806 18.946 ↑ 10.5 174 2

Sort (cost=5,453.60..5,458.14 rows=1,819 width=1,995) (actual time=9.445..9.473 rows=174 loops=2)

  • Sort Key: e0.id DESC
  • Sort Method: quicksort Memory: 724kB
  • Worker 0: Sort Method: quicksort Memory: 29kB
10. 0.216 18.140 ↑ 10.5 174 2

Hash Left Join (cost=831.79..5,355.11 rows=1,819 width=1,995) (actual time=8.837..9.070 rows=174 loops=2)

  • Hash Cond: (e3."VenueId" = v4."VenueId")
11. 0.354 17.858 ↑ 33.5 40 2

Hash Left Join (cost=829.87..5,318.23 rows=1,341 width=1,991) (actual time=8.753..8.929 rows=40 loops=2)

  • Hash Cond: (e0.id = e3."EventId")
12. 0.370 0.450 ↑ 33.2 40 2

Parallel Bitmap Heap Scan on "Events" e0 (cost=66.38..4,533.01 rows=1,330 width=1,987) (actual time=0.069..0.225 rows=40 loops=2)

  • Recheck Cond: ((("offSaleDate" >= '2019-08-13 00:00:00+04'::timestamp with time zone) AND (state = 'approved'::event_states)) OR ('{petre+dice@dice.fm}'::citext[] <@ read_access_emails))
  • Heap Blocks: exact=49
13. 0.001 0.080 ↓ 0.0 0 1

BitmapOr (cost=66.38..66.38 rows=2,261 width=0) (actual time=0.080..0.080 rows=0 loops=1)

14. 0.046 0.046 ↑ 28.6 79 1

Bitmap Index Scan on "Events_offSaleDate_idx" (cost=0.00..45.24 rows=2,260 width=0) (actual time=0.046..0.046 rows=79 loops=1)

  • Index Cond: ("offSaleDate" >= '2019-08-13 00:00:00+04'::timestamp with time zone)
15. 0.033 0.033 ↑ 1.0 1 1

Bitmap Index Scan on "Events_read_access_emails_index" (cost=0.00..20.01 rows=1 width=0) (actual time=0.033..0.033 rows=1 loops=1)

  • Index Cond: ('{petre+dice@dice.fm}'::citext[] <@ read_access_emails)
16. 8.530 17.054 ↑ 1.0 26,422 2

Hash (cost=433.22..433.22 rows=26,422 width=8) (actual time=8.526..8.527 rows=26,422 loops=2)

  • Buckets: 32768 Batches: 1 Memory Usage: 1289kB
17. 8.524 8.524 ↑ 1.0 26,422 2

Seq Scan on "EventVenues" e3 (cost=0.00..433.22 rows=26,422 width=8) (actual time=0.024..4.262 rows=26,422 loops=2)

18. 0.016 0.066 ↑ 1.0 41 2

Hash (cost=1.41..1.41 rows=41 width=16) (actual time=0.033..0.033 rows=41 loops=2)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
19. 0.050 0.050 ↑ 1.0 41 2

Seq Scan on "VenueUsers" v4 (cost=0.00..1.41 rows=41 width=16) (actual time=0.021..0.025 rows=41 loops=2)

20. 11.672 19.630 ↑ 3.8 6,550 2

Sort (cost=2,248.47..2,310.67 rows=24,881 width=8) (actual time=9.346..9.815 rows=6,550 loops=2)

  • Sort Key: e1."EventId" DESC
  • Sort Method: quicksort Memory: 1935kB
  • Worker 0: Sort Method: quicksort Memory: 1935kB
21. 7.958 7.958 ↑ 1.0 24,881 2

Seq Scan on "EventPromoters" e1 (cost=0.00..431.81 rows=24,881 width=8) (actual time=0.018..3.979 rows=24,881 loops=2)

22. 1.047 1.047 ↓ 4.5 9 349

Index Only Scan using "PromoterUsers_PromoterId_UserId_index" on "PromoterUsers" p2 (cost=0.14..0.18 rows=2 width=16) (actual time=0.001..0.003 rows=9 loops=349)

  • Index Cond: ("PromoterId" = e1."PromoterId")
  • Heap Fetches: 3011
23. 3.029 6.058 ↑ 1.0 1 3,029

Bitmap Heap Scan on "Users" (cost=2.00..6.02 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=3,029)

  • Recheck Cond: (((id = 5518) AND (v4."UserId" = id)) OR (p2."UserId" = id))
  • Heap Blocks: exact=3011
24. 0.000 3.029 ↓ 0.0 0 3,029

BitmapOr (cost=2.00..2.00 rows=1 width=0) (actual time=0.001..0.001 rows=0 loops=3,029)

25. 0.000 0.000 ↓ 0.0 0 3,029

Bitmap Index Scan on "Users_pkey" (cost=0.00..0.87 rows=1 width=0) (actual time=0.000..0.000 rows=0 loops=3,029)

  • Index Cond: ((id = 5518) AND (v4."UserId" = id))
26. 3.029 3.029 ↑ 1.0 1 3,029

Bitmap Index Scan on "Users_pkey" (cost=0.00..0.45 rows=1 width=0) (actual time=0.001..0.001 rows=1 loops=3,029)

  • Index Cond: (p2."UserId" = id)
Planning time : 4.978 ms
Execution time : 41.480 ms