explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Fp0

Settings
# exclusive inclusive rows x rows loops node
1. 0.010 2.043 ↑ 1.7 3 1

Sort (cost=319.23..319.24 rows=5 width=44) (actual time=2.043..2.043 rows=3 loops=1)

  • Sort Key: (count(*)) DESC
  • Sort Method: quicksort Memory: 25kB
2. 0.021 2.033 ↑ 1.7 3 1

GroupAggregate (cost=319.05..319.17 rows=5 width=44) (actual time=2.031..2.033 rows=3 loops=1)

  • Group Key: order_discount_details.offertable_id
3. 0.017 2.012 ↓ 10.6 53 1

Sort (cost=319.05..319.07 rows=5 width=9) (actual time=2.008..2.012 rows=53 loops=1)

  • Sort Key: order_discount_details.offertable_id
  • Sort Method: quicksort Memory: 27kB
4. 0.059 1.995 ↓ 10.6 53 1

Nested Loop (cost=1.56..319.00 rows=5 width=9) (actual time=0.926..1.995 rows=53 loops=1)

5. 0.000 1.687 ↓ 4.6 83 1

Nested Loop (cost=1.00..306.10 rows=18 width=4) (actual time=0.853..1.687 rows=83 loops=1)

6. 1.322 1.322 ↓ 2.4 92 1

Index Scan using orders_application_user_id_state_id_index on orders (cost=0.56..202.26 rows=39 width=4) (actual time=0.840..1.322 rows=92 loops=1)

  • Index Cond: ((application_user_id = 1327902) AND ((state)::text = ANY ('{storekeeper_payment_canceled,paid_to_sk,storekeeper_payment_in_analysis,scheduled,created,in_progress,on_the_route,in_store,pending_storekeeper_confirmation,arrive,expediter_taken,pending_review,finished}'::text[])))
  • Filter: (created_at > (('now'::cstring)::date - '90 days'::interval day))
  • Rows Removed by Filter: 1234
7. 0.368 0.368 ↑ 1.0 1 92

Index Scan using order_discounts_order_id_index on order_discounts (cost=0.43..2.65 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=92)

  • Index Cond: (order_id = orders.id)
8. 0.249 0.249 ↑ 2.0 1 83

Index Only Scan using order_discount_details_id_offertable_id_type_value_index on order_discount_details (cost=0.56..0.70 rows=2 width=13) (actual time=0.003..0.003 rows=1 loops=83)

  • Index Cond: ((order_discount_id = order_discounts.id) AND (type = '7'::text))
  • Heap Fetches: 3