explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Gdoc

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 133,265.714 ↓ 0.0 0 1

Limit (cost=104,504.71..104,945.69 rows=25 width=8) (actual time=133,265.714..133,265.714 rows=0 loops=1)

2.          

CTE get_gift_card_orders_ids

3. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=29.24..10,469.01 rows=183 width=8) (never executed)

4. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on gift_card (cost=28.68..1,173.22 rows=1,082 width=8) (never executed)

  • Recheck Cond: (store_id = 15658562)
5. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on ix_gift_card_store_id (cost=0.00..28.41 rows=1,082 width=0) (never executed)

  • Index Cond: (store_id = 15658562)
6. 0.000 0.000 ↓ 0.0 0

Index Scan using cart_product_pkey on cart_product (cost=0.56..8.58 rows=1 width=16) (never executed)

  • Index Cond: (id = gift_card.cart_product_id)
7.          

CTE ecom_fulfillment_order_ids

8. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on fulfillment (cost=759.23..91,407.41 rows=27,716 width=8) (never executed)

  • Recheck Cond: ((store_id = 15658562) AND ((cycle_number = (-1)) OR (cycle_number IS NULL)))
9. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on fulfillment_store_id_idx (cost=0.00..752.30 rows=27,716 width=0) (never executed)

  • Index Cond: (store_id = 15658562)
10. 0.002 133,265.712 ↓ 0.0 0 1

Group (cost=2,610.64..1,163,425.00 rows=65,808 width=8) (actual time=133,265.712..133,265.712 rows=0 loops=1)

  • Group Key: "order".id
11. 0.001 133,265.710 ↓ 0.0 0 1

Merge Left Join (cost=2,610.64..1,163,260.48 rows=65,808 width=8) (actual time=133,265.710..133,265.710 rows=0 loops=1)

  • Merge Cond: ("order".id = ecom_fulfillment_order_ids.ecom_fulfillment_order_id)
  • Filter: ((get_gift_card_orders_ids.cart_product_order_id IS NOT NULL) OR (ecom_fulfillment_order_ids.ecom_fulfillment_order_id IS NOT NULL))
12. 0.002 133,265.709 ↓ 0.0 0 1

Merge Left Join (cost=11.10..1,160,357.05 rows=65,810 width=16) (actual time=133,265.709..133,265.709 rows=0 loops=1)

  • Merge Cond: ("order".id = get_gift_card_orders_ids.cart_product_order_id)
13. 133,265.707 133,265.707 ↓ 0.0 0 1

Index Scan Backward using order_id_store_id_placed_at_idx on "order" (cost=0.56..1,160,181.07 rows=65,810 width=8) (actual time=133,265.707..133,265.707 rows=0 loops=1)

  • Index Cond: (store_id = 15658562)
  • Filter: ((is_renewal IS FALSE) AND (financial_status <> 1) AND (id <> id))
  • Rows Removed by Filter: 254632
14. 0.000 0.000 ↓ 0.0 0

Sort (cost=10.54..10.99 rows=183 width=8) (never executed)

  • Sort Key: get_gift_card_orders_ids.cart_product_order_id
15. 0.000 0.000 ↓ 0.0 0

CTE Scan on get_gift_card_orders_ids (cost=0.00..3.66 rows=183 width=8) (never executed)

16. 0.000 0.000 ↓ 0.0 0

Sort (cost=2,599.54..2,668.83 rows=27,716 width=8) (never executed)

  • Sort Key: ecom_fulfillment_order_ids.ecom_fulfillment_order_id
17. 0.000 0.000 ↓ 0.0 0

CTE Scan on ecom_fulfillment_order_ids (cost=0.00..554.32 rows=27,716 width=8) (never executed)

Planning time : 3.698 ms
Execution time : 133,265.886 ms