explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Vq6V

Settings
# exclusive inclusive rows x rows loops node
1. 0.008 1,178.561 ↑ 1.0 30 1

Limit (cost=236,970.23..237,260.05 rows=30 width=4,088) (actual time=1,177.428..1,178.561 rows=30 loops=1)

2. 0.094 1,178.553 ↑ 3,959.2 30 1

Result (cost=236,970.23..1,384,413.15 rows=118,776 width=4,088) (actual time=1,177.423..1,178.553 rows=30 loops=1)

3. 212.594 1,177.409 ↑ 3,959.2 30 1

Sort (cost=236,970.23..237,267.17 rows=118,776 width=4,076) (actual time=1,177.377..1,177.409 rows=30 loops=1)

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

Nested Loop Left Join (cost=1.26..233,462.25 rows=118,776 width=4,076) (actual time=0.039..964.815 rows=117,670 loops=1)

5. 109.383 302.466 ↑ 1.0 117,670 1

Merge Join (cost=0.84..21,196.18 rows=118,776 width=1,557) (actual time=0.020..302.466 rows=117,670 loops=1)

  • Merge Cond: (user_consumer.user_uid = "user".uid)
6. 79.166 79.166 ↓ 1.0 119,342 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..79.166 rows=119,342 loops=1)

7. 113.917 113.917 ↓ 1.0 133,853 1

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

8. 0.000 588.350 ↑ 1.0 1 117,670

Limit (cost=0.42..1.77 rows=1 width=2,497) (actual time=0.005..0.005 rows=1 loops=117,670)

9. 588.350 588.350 ↑ 5.0 1 117,670

Index Scan using booking_customer_uid_to_timestamp_idx on booking (cost=0.42..7.15 rows=5 width=2,497) (actual time=0.005..0.005 rows=1 loops=117,670)

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

SubPlan (forResult)

11. 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)

12. 0.660 0.660 ↓ 5.6 28 30

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

  • Index Cond: (customer_uid = "user".uid)
13. 0.060 0.330 ↑ 1.0 1 30

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

14. 0.270 0.270 ↓ 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.004..0.009 rows=7 loops=30)

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