explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xkO

Settings
# exclusive inclusive rows x rows loops node
1. 0.007 1,859.300 ↑ 1.0 30 1

Limit (cost=879,067.30..879,357.12 rows=30 width=4,088) (actual time=1,858.257..1,859.300 rows=30 loops=1)

2. 0.073 1,859.293 ↑ 3,959.2 30 1

Result (cost=879,067.30..2,026,510.22 rows=118,776 width=4,088) (actual time=1,858.253..1,859.293 rows=30 loops=1)

3. 229.966 1,858.230 ↑ 3,959.2 30 1

Sort (cost=879,067.30..879,364.24 rows=118,776 width=4,076) (actual time=1,858.211..1,858.230 rows=30 loops=1)

  • Sort Key: (to_timestamp((booking.starttime)::double precision)) DESC NULLS LAST
  • Sort Method: top-N heapsort Memory: 105kB
4. 112.928 1,628.264 ↑ 1.0 117,671 1

Nested Loop Left Join (cost=8.01..875,559.32 rows=118,776 width=4,076) (actual time=0.056..1,628.264 rows=117,671 loops=1)

5. 130.542 338.626 ↑ 1.0 117,671 1

Merge Join (cost=0.84..21,196.18 rows=118,776 width=1,557) (actual time=0.021..338.626 rows=117,671 loops=1)

  • Merge Cond: (user_consumer.user_uid = "user".uid)
6. 82.560 82.560 ↓ 1.0 119,343 1

Index Scan using user_consumer_user_uid_index on user_consumer (cost=0.42..4,053.51 rows=118,776 width=643) (actual time=0.007..82.560 rows=119,343 loops=1)

7. 125.524 125.524 ↓ 1.0 133,855 1

Index Scan using user_pkey on "user" (cost=0.42..15,324.81 rows=133,266 width=914) (actual time=0.010..125.524 rows=133,855 loops=1)

8. 117.671 1,176.710 ↑ 1.0 1 117,671

Limit (cost=7.17..7.17 rows=1 width=2,497) (actual time=0.010..0.010 rows=1 loops=117,671)

9. 353.013 1,059.039 ↑ 5.0 1 117,671

Sort (cost=7.17..7.18 rows=5 width=2,497) (actual time=0.009..0.009 rows=1 loops=117,671)

  • Sort Key: (to_timestamp((booking.starttime)::double precision)) DESC NULLS LAST
  • Sort Method: quicksort Memory: 25kB
10. 706.026 706.026 ↑ 2.5 2 117,671

Index Scan using b_i_1 on booking (cost=0.42..7.15 rows=5 width=2,497) (actual time=0.004..0.006 rows=2 loops=117,671)

  • Index Cond: (customer_uid = "user".uid)
11.          

SubPlan (forResult)

12. 0.060 0.720 ↑ 1.0 1 30

Aggregate (cost=7.12..7.13 rows=1 width=8) (actual time=0.024..0.024 rows=1 loops=30)

13. 0.660 0.660 ↓ 5.6 28 30

Index Scan using b_i_1 on booking booking_1 (cost=0.42..7.11 rows=5 width=16) (actual time=0.005..0.022 rows=28 loops=30)

  • Index Cond: (customer_uid = "user".uid)
14. 0.030 0.270 ↑ 1.0 1 30

Aggregate (cost=2.51..2.52 rows=1 width=4) (actual time=0.009..0.009 rows=1 loops=30)

15. 0.240 0.240 ↓ 7.0 7 30

Index Scan using payment_user_id_idx on payment (cost=0.29..2.51 rows=1 width=4) (actual time=0.003..0.008 rows=7 loops=30)

  • Index Cond: (user_id = "user".uid)
Planning time : 1.016 ms
Execution time : 1,859.771 ms