explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4Jja

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 115.663 ↑ 1.0 1 1

Limit (cost=17,182,306.46..17,182,306.46 rows=1 width=1,854) (actual time=115.661..115.663 rows=1 loops=1)

2. 0.063 115.659 ↑ 1.0 1 1

Sort (cost=17,182,306.46..17,182,306.46 rows=1 width=1,854) (actual time=115.658..115.659 rows=1 loops=1)

  • Sort Key: orders.processed_at
  • Sort Method: quicksort Memory: 25kB
3. 0.051 115.596 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.29..17,182,306.45 rows=1 width=1,854) (actual time=28.196..115.596 rows=1 loops=1)

  • Join Filter: (order_origins.id = orders.order_origin_id)
  • Rows Removed by Join Filter: 104
4. 7.939 115.131 ↑ 1.0 1 1

Index Scan using orders_status_idx on orders (cost=0.29..17,182,297.27 rows=1 width=1,036) (actual time=27.733..115.131 rows=1 loops=1)

  • Index Cond: (status = ANY ('{purchasing,ordered,assigning}'::order_status_enum[]))
  • Filter: ((processed_at >= '2020-09-04 00:00:00+07'::timestamp with time zone) AND (eatery_id = 1,347,246) AND (((processed_at <= '2020-09-04 23:59:59+07'::timestamp with time zone) AND (service_name <> 'lozat'::orders_service_name_enum)) OR ((processed_at <= '2020-09-07 23:59:59+07'::timestamp with time zone) AND (service_name = 'lozat'::orders_service_name_enum))) AND (SubPlan 1))
  • Rows Removed by Filter: 4,547
5.          

SubPlan (for Index Scan)

6. 0.052 107.192 ↓ 0.0 0 4

Limit (cost=0.00..3,773.88 rows=1 width=0) (actual time=26.798..26.798 rows=0 loops=4)

7. 107.140 107.140 ↓ 0.0 0 4

Seq Scan on shipping_transactions (cost=0.00..3,773.88 rows=1 width=0) (actual time=26.785..26.785 rows=0 loops=4)

  • Filter: ((order_id = orders.id) AND (action = 'purchasing'::order_status_enum))
  • Rows Removed by Filter: 79,241
8. 0.414 0.414 ↑ 1.4 104 1

Seq Scan on order_origins (cost=0.00..7.41 rows=141 width=818) (actual time=0.028..0.414 rows=104 loops=1)

Planning time : 5.059 ms