explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9qd2

Settings
# exclusive inclusive rows x rows loops node
1. 0.008 2,347.672 ↑ 1.0 1 1

Limit (cost=10,648.74..10,648.74 rows=1 width=26) (actual time=2,347.667..2,347.672 rows=1 loops=1)

2. 74.320 2,347.664 ↑ 1.0 1 1

Sort (cost=10,648.74..10,648.74 rows=1 width=26) (actual time=2,347.664..2,347.664 rows=1 loops=1)

  • Sort Key: orders.source_created_at DESC
  • Sort Method: top-N heapsort Memory: 25kB
3. 132.410 2,273.344 ↓ 374,927.0 374,927 1

Nested Loop (cost=2.12..10,648.73 rows=1 width=26) (actual time=2.298..2,273.344 rows=374,927 loops=1)

4. 55.898 641.226 ↓ 12,928.5 374,927 1

Nested Loop (cost=1.55..10,575.39 rows=29 width=22) (actual time=2.272..641.226 rows=374,927 loops=1)

5. 123.623 200.839 ↓ 678.1 6,103 1

Nested Loop (cost=0.99..5,529.52 rows=9 width=22) (actual time=2.230..200.839 rows=6,103 loops=1)

  • Join Filter: ((product_collections.uid)::text = ANY (products.category_uids))
  • Rows Removed by Join Filter: 574,649
6. 40.592 40.592 ↓ 1.2 2,616 1

Index Scan using index_products_on_store_id_and_uid on products (cost=0.56..2,467.23 rows=2,189 width=24) (actual time=0.035..40.592 rows=2,616 loops=1)

  • Index Cond: (store_id = 3,420)
7. 34.553 36.624 ↓ 4.0 222 2,616

Materialize (cost=0.42..52.55 rows=55 width=26) (actual time=0.000..0.014 rows=222 loops=2,616)

8. 2.071 2.071 ↓ 4.0 222 1

Index Scan using index_product_collections_on_store_id on product_collections (cost=0.42..52.28 rows=55 width=26) (actual time=0.085..2.071 rows=222 loops=1)

  • Index Cond: (store_id = 3,420)
9. 384.489 384.489 ↑ 12.8 61 6,103

Index Scan using index_order_products_on_product_id on order_products (cost=0.56..552.85 rows=780 width=8) (actual time=0.004..0.063 rows=61 loops=6,103)

  • Index Cond: (product_id = products.id)
10. 1,499.708 1,499.708 ↑ 1.0 1 374,927

Index Scan using orders_pkey on orders (cost=0.56..2.53 rows=1 width=12) (actual time=0.004..0.004 rows=1 loops=374,927)

  • Index Cond: (id = order_products.order_id)
  • Filter: (store_id = 3,420)
Planning time : 1.484 ms
Execution time : 2,347.758 ms