explain.depesz.com

PostgreSQL's explain analyze made readable

Result: VnRF

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 195.706 ↑ 1.0 1 1

Aggregate (cost=117,652.53..117,652.54 rows=1 width=32) (actual time=195.706..195.706 rows=1 loops=1)

2. 0.000 195.706 ↓ 0.0 0 1

Nested Loop (cost=29,448.15..117,652.53 rows=1 width=4) (actual time=195.705..195.706 rows=0 loops=1)

3. 1.149 189.635 ↑ 3.2 3,236 1

Nested Loop (cost=29,447.59..111,416.11 rows=10,262 width=4) (actual time=134.584..189.635 rows=3,236 loops=1)

4. 4.698 138.838 ↑ 3.8 6,206 1

Bitmap Heap Scan on orders (cost=29,447.15..55,294.25 rows=23,529 width=4) (actual time=134.567..138.838 rows=6,206 loops=1)

  • Recheck Cond: (((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}'::text[])) AND (created_at >= '2019-03-01 00:00:00'::timestamp without time zone) AND (created_at <= '2019-04-01 00:00:00'::timestamp without time zone))
  • Filter: (id <> 123133)
  • Heap Blocks: exact=2148
5. 15.294 134.140 ↓ 0.0 0 1

BitmapAnd (cost=29,447.15..29,447.15 rows=23,529 width=0) (actual time=134.140..134.140 rows=0 loops=1)

6. 36.655 36.655 ↑ 2.6 290,626 1

Bitmap Index Scan on orders_state_index (cost=0.00..9,560.02 rows=749,808 width=0) (actual time=36.655..36.655 rows=290,626 loops=1)

  • Index Cond: ((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}'::text[]))
7. 82.191 82.191 ↑ 1.1 865,579 1

Bitmap Index Scan on orders_created_at_index (cost=0.00..19,875.12 rows=910,226 width=0) (actual time=82.191..82.191 rows=865,579 loops=1)

  • Index Cond: ((created_at >= '2019-03-01 00:00:00'::timestamp without time zone) AND (created_at <= '2019-04-01 00:00:00'::timestamp without time zone))
8. 49.648 49.648 ↑ 1.0 1 6,206

Index Scan using order_discounts_order_id_index on order_discounts (cost=0.43..2.38 rows=1 width=8) (actual time=0.008..0.008 rows=1 loops=6,206)

  • Index Cond: (order_id = orders.id)
9. 6.472 6.472 ↓ 0.0 0 3,236

Index Only Scan using order_discount_details_id_offertable_id_type_value_index on order_discount_details (cost=0.56..0.60 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=3,236)

  • Index Cond: ((order_discount_id = order_discounts.id) AND (offertable_id = 753) AND (type = 'max_discount_per_cc'::text))
  • Heap Fetches: 0