explain.depesz.com

PostgreSQL's explain analyze made readable

Result: rP35

Settings
# exclusive inclusive rows x rows loops node
1. 0.612 23.266 ↓ 799.0 799 1

Unique (cost=352.16..352.18 rows=1 width=161) (actual time=22.411..23.266 rows=799 loops=1)

2. 3.004 22.654 ↓ 1,293.0 1,293 1

Sort (cost=352.16..352.17 rows=1 width=161) (actual time=22.409..22.654 rows=1,293 loops=1)

  • Sort Key: users.email, ticket_owner_consent.user_id, ticket_owner_consent.consent_request_id, ticket_owner_consent.created, ticket_owner_consent.expires, ticket_owner_consent.purchase_id, consent_req
  • Sort Method: quicksort Memory: 329kB
3. 0.827 19.650 ↓ 1,293.0 1,293 1

Nested Loop (cost=2.29..352.15 rows=1 width=161) (actual time=0.101..19.650 rows=1,293 loops=1)

4. 1.507 17.188 ↓ 1,635.0 1,635 1

Nested Loop (cost=2.15..352.00 rows=1 width=70) (actual time=0.053..17.188 rows=1,635 loops=1)

5. 1.193 12.411 ↓ 1,635.0 1,635 1

Nested Loop (cost=1.73..351.50 rows=1 width=56) (actual time=0.047..12.411 rows=1,635 loops=1)

6. 0.590 6.790 ↓ 1,476.0 1,476 1

Nested Loop (cost=1.44..351.13 rows=1 width=16) (actual time=0.034..6.790 rows=1,476 loops=1)

7. 0.771 1.772 ↓ 1,476.0 1,476 1

Nested Loop (cost=1.01..349.06 rows=1 width=16) (actual time=0.028..1.772 rows=1,476 loops=1)

8. 0.003 0.018 ↑ 1.0 1 1

Nested Loop (cost=0.58..5.29 rows=1 width=16) (actual time=0.017..0.018 rows=1 loops=1)

9. 0.010 0.010 ↑ 1.0 1 1

Index Scan using events_pkey on events (cost=0.29..2.31 rows=1 width=16) (actual time=0.010..0.010 rows=1 loops=1)

  • Index Cond: (event_id = '3907656401'::bigint)
10. 0.005 0.005 ↑ 1.0 1 1

Index Scan using event_types_pkey on event_types (cost=0.29..2.31 rows=1 width=16) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (event_type_id = events.event_type_id)
  • Filter: (organization_id = 557857847)
11. 0.983 0.983 ↑ 4.5 1,476 1

Index Scan using reserved_or_sold_tickets on tickets (cost=0.43..277.49 rows=6,628 width=16) (actual time=0.010..0.983 rows=1,476 loops=1)

  • Index Cond: (event_id = '3907656401'::bigint)
12. 4.428 4.428 ↑ 1.0 1 1,476

Index Scan using purchases_pkey on purchases (cost=0.43..2.07 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=1,476)

  • Index Cond: (purchase_id = tickets.purchase_id)
  • Filter: (finalized IS NOT NULL)
13. 4.428 4.428 ↑ 1.0 1 1,476

Index Scan using ticket_owner_consent_user_id_idx on ticket_owner_consent (cost=0.29..0.36 rows=1 width=40) (actual time=0.002..0.003 rows=1 loops=1,476)

  • Index Cond: (user_id = purchases.user_id)
  • Filter: (is_valid AND (expires > now()))
  • Rows Removed by Filter: 0
14. 3.270 3.270 ↑ 1.0 1 1,635

Index Scan using users_pkey on users (cost=0.42..0.50 rows=1 width=30) (actual time=0.002..0.002 rows=1 loops=1,635)

  • Index Cond: (user_id = purchases.user_id)
15. 1.635 1.635 ↑ 1.0 1 1,635

Index Scan using consent_requests_consent_request_id_idx on consent_requests (cost=0.13..0.15 rows=1 width=115) (actual time=0.001..0.001 rows=1 loops=1,635)

  • Index Cond: (consent_request_id = ticket_owner_consent.consent_request_id)
Planning time : 2.724 ms
Execution time : 23.505 ms