explain.depesz.com

PostgreSQL's explain analyze made readable

Result: pZBM

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 21.815 ↑ 1.0 1 1

Limit (cost=189.15..189.16 rows=1 width=26) (actual time=21.811..21.815 rows=1 loops=1)

2. 0.099 21.809 ↑ 1.0 1 1

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

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

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

4. 0.013 15.142 ↓ 3.0 3 1

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

5. 0.014 6.015 ↓ 1.5 3 1

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

6. 2.345 2.345 ↑ 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=2.344..2.345 rows=1 loops=1)

  • Index Cond: ((store_id = 3,420) AND ((subscriber_uid)::text = 'sophiegrainger2'::text))
7. 3.656 3.656 ↑ 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=1.777..3.656 rows=3 loops=1)

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

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

  • Index Cond: (id = order_products.product_id)
  • Filter: (store_id = 3,420)
9. 0.888 6.537 ↑ 1.0 1 3

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

  • Recheck Cond: ((store_id = 3,420) AND ((uid)::text = ANY (products.category_uids)))
  • Heap Blocks: exact=3
10. 0.042 5.649 ↓ 0.0 0 3

BitmapAnd (cost=16.47..16.47 rows=1 width=0) (actual time=1.883..1.883 rows=0 loops=3)

11. 3.126 3.126 ↓ 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=1.041..1.042 rows=245 loops=3)

  • Index Cond: (store_id = 3,420)
12. 2.481 2.481 ↓ 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.827..0.827 rows=50 loops=3)

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