explain.depesz.com

PostgreSQL's explain analyze made readable

Result: XSfs

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

Limit (cost=278.03..405.19 rows=19 width=328) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Result (cost=278.03..405.19 rows=19 width=328) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Sort (cost=278.03..278.08 rows=19 width=1,025) (actual rows= loops=)

  • Sort Key: __local_0__.created_at DESC
4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=229.75..277.63 rows=19 width=1,025) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

HashAggregate (cost=229.46..229.65 rows=19 width=16) (actual rows= loops=)

  • Group Key: seats.seat_id
6. 0.000 0.000 ↓ 0.0

Index Scan using seats_seat_ancestor_path_gist_idx on seats (cost=2.97..229.22 rows=19 width=16) (actual rows= loops=)

  • Index Cond: (seat_ancestor_path <@ $10)
  • Filter: ((seat_ancestor_path <> $11) AND ((seat_number)::double precision <= ((($12)::double precision * '32768'::double precision) + '32767'::double precision)))
7.          

CTE _seat_path

8. 0.000 0.000 ↓ 0.0

Index Scan using seats_pkey on seats seats_1 (cost=0.29..2.51 rows=1 width=769) (actual rows= loops=)

  • Index Cond: (seat_id = '5f872e23-7485-42eb-ab40-b8dce43c5812'::uuid)
9.          

Initplan (for Index Scan)

10. 0.000 0.000 ↓ 0.0

CTE Scan on _seat_path (cost=0.00..0.02 rows=1 width=32) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

CTE Scan on _seat_path _seat_path_1 (cost=0.00..0.02 rows=1 width=32) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

CTE Scan on _seat_path _seat_path_2 (cost=0.00..0.02 rows=1 width=32) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Index Scan using seats_pkey on seats __local_0__ (cost=0.29..2.51 rows=1 width=961) (actual rows= loops=)

  • Index Cond: (seat_id = seats.seat_id)
14.          

SubPlan (for Result)

15. 0.000 0.000 ↓ 0.0

Function Scan on seats_invites __local_1__ (cost=0.25..0.26 rows=1 width=32) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Function Scan on seats_last_invite_date __local_2__ (cost=0.25..0.26 rows=1 width=32) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Function Scan on seats_last_purchase_date __local_3__ (cost=0.25..0.26 rows=1 width=32) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Function Scan on seats_earned_from_seat_by_invoker_seat_id __local_4__ (cost=0.25..0.27 rows=1 width=32) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Function Scan on seats_total_spent_amount __local_5__ (cost=0.25..0.26 rows=1 width=32) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Function Scan on seats_total_purchase_count __local_6__ (cost=0.25..0.27 rows=1 width=32) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Index Scan using accounts_pkey on accounts __local_7__ (cost=0.29..5.07 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (__local_0__.seat_owner_id = account_id)
22.          

SubPlan (for Index Scan)

23. 0.000 0.000 ↓ 0.0

Result (cost=2.55..2.56 rows=1 width=32) (actual rows= loops=)

24.          

Initplan (for Result)

25. 0.000 0.000 ↓ 0.0

Aggregate (cost=2.54..2.55 rows=1 width=32) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Sort (cost=2.52..2.52 rows=1 width=3,772) (actual rows= loops=)

  • Sort Key: __local_9__.user_id
27. 0.000 0.000 ↓ 0.0

Index Scan using users_owned_account_id_index on users __local_9__ (cost=0.29..2.51 rows=1 width=3,772) (actual rows= loops=)

  • Index Cond: (owned_account_id = __local_7__.account_id)