explain.depesz.com

PostgreSQL's explain analyze made readable

Result: yGqX

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

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

2. 0.069 1,713.065 ↑ 3,959.2 30 1

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

3. 208.532 1,712.066 ↑ 3,959.2 30 1

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

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

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

5. 121.789 311.612 ↑ 1.0 117,670 1

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

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

7. 114.332 114.332 ↓ 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.009..114.332 rows=133,853 loops=1)

8. 0.000 1,059.030 ↑ 1.0 1 117,670

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

9. 470.680 1,059.030 ↑ 5.0 1 117,670

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

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

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

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

SubPlan (forResult)

12. 0.060 0.660 ↑ 1.0 1 30

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

13. 0.600 0.600 ↓ 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.004..0.020 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.668 ms
Execution time : 1,713.529 ms