explain.depesz.com

PostgreSQL's explain analyze made readable

Result: cnIP : last collection purchased by subscriber query - non shopify stores

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

Limit (cost=189.15..189.16 rows=1 width=26) (actual time=0.362..0.364 rows=1 loops=1)

2. 0.015 0.360 ↑ 1.0 1 1

Sort (cost=189.15..189.16 rows=1 width=26) (actual time=0.360..0.360 rows=1 loops=1)

  • Sort Key: orders.source_created_at DESC
  • Sort Method: top-N heapsort Memory: 25kB
3. 0.009 0.345 ↓ 3.0 3 1

Nested Loop (cost=18.03..189.14 rows=1 width=26) (actual time=0.219..0.345 rows=3 loops=1)

4. 0.003 0.132 ↓ 3.0 3 1

Nested Loop (cost=1.56..171.54 rows=1 width=28) (actual time=0.095..0.132 rows=3 loops=1)

5. 0.008 0.072 ↓ 1.5 3 1

Nested Loop (cost=1.13..166.75 rows=2 width=12) (actual time=0.063..0.072 rows=3 loops=1)

6. 0.028 0.028 ↑ 1.0 1 1

Index Scan using index_orders_on_store_id_and_subscriber_uid on orders (cost=0.56..2.78 rows=1 width=12) (actual time=0.028..0.028 rows=1 loops=1)

  • Index Cond: ((store_id = 3420) AND ((subscriber_uid)::text = 'sophiegrainger2'::text))
7. 0.036 0.036 ↑ 100.0 3 1

Index Scan using index_order_products_on_order_id on order_products (cost=0.56..160.96 rows=300 width=8) (actual time=0.030..0.036 rows=3 loops=1)

  • Index Cond: (order_id = orders.id)
8. 0.057 0.057 ↑ 1.0 1 3

Index Scan using products_pkey on products (cost=0.43..2.40 rows=1 width=24) (actual time=0.019..0.019 rows=1 loops=3)

  • Index Cond: (id = order_products.product_id)
  • Filter: (store_id = 3420)
9. 0.012 0.204 ↑ 1.0 1 3

Bitmap Heap Scan on product_collections (cost=16.46..17.59 rows=1 width=26) (actual time=0.068..0.068 rows=1 loops=3)

  • Recheck Cond: ((store_id = 3420) AND ((uid)::text = ANY (products.category_uids)))
  • Heap Blocks: exact=3
10. 0.027 0.192 ↓ 0.0 0 3

BitmapAnd (cost=16.46..16.46 rows=1 width=0) (actual time=0.064..0.064 rows=0 loops=3)

11. 0.108 0.108 ↓ 4.5 245 3

Bitmap Index Scan on index_product_collections_on_store_id (cost=0.00..1.94 rows=55 width=0) (actual time=0.036..0.036 rows=245 loops=3)

  • Index Cond: (store_id = 3420)
12. 0.057 0.057 ↓ 1.2 50 3

Bitmap Index Scan on index_product_collections_on_uid (cost=0.00..14.26 rows=41 width=0) (actual time=0.018..0.019 rows=50 loops=3)

  • Index Cond: ((uid)::text = ANY (products.category_uids))
Planning time : 1.535 ms
Execution time : 0.486 ms