explain.depesz.com

PostgreSQL's explain analyze made readable

Result: TQ4s

Settings
# exclusive inclusive rows x rows loops node
1. 0.329 838.661 ↓ 2.5 201 1

Sort (cost=562.64..562.84 rows=80 width=77) (actual time=838.634..838.661 rows=201 loops=1)

  • Sort Key: orders.id DESC
  • Sort Method: quicksort Memory: 50kB
2. 0.151 838.332 ↓ 2.5 201 1

Nested Loop Left Join (cost=2.25..560.11 rows=80 width=77) (actual time=7.613..838.332 rows=201 loops=1)

3. 0.289 736.311 ↓ 2.9 167 1

Nested Loop Left Join (cost=1.69..383.97 rows=57 width=50) (actual time=7.611..736.311 rows=167 loops=1)

4. 0.217 436.758 ↓ 2.9 167 1

Nested Loop Left Join (cost=1.13..224.94 rows=57 width=46) (actual time=3.517..436.758 rows=167 loops=1)

5. 3.677 3.677 ↓ 2.9 167 1

Index Scan using orders_application_user_id_state_id_created_at_idx_dba on orders (cost=0.56..65.77 rows=57 width=32) (actual time=1.953..3.677 rows=167 loops=1)

  • Index Cond: ((application_user_id = 14358921) AND (created_at >= '2019-06-12 15:19:36.942013'::timestamp without time zone))
6. 432.864 432.864 ↑ 1.0 1 167

Index Scan using orders_pkey on orders calculated (cost=0.56..2.78 rows=1 width=18) (actual time=2.565..2.592 rows=1 loops=167)

  • Index Cond: (order_id = orders.id)
7. 299.264 299.264 ↑ 1.0 1 167

Index Scan using order_discounts_order_id_index on order_discounts (cost=0.56..2.78 rows=1 width=8) (actual time=1.792..1.792 rows=1 loops=167)

  • Index Cond: (order_id = orders.id)
8. 101.870 101.870 ↑ 14.0 1 167

Index Scan using order_discount_details_order_discount_id_index_dba on order_discount_details (cost=0.56..2.95 rows=14 width=35) (actual time=0.610..0.610 rows=1 loops=167)

  • Index Cond: (order_discount_id = order_discounts.id)
Planning time : 16.517 ms
Execution time : 838.778 ms