explain.depesz.com

PostgreSQL's explain analyze made readable

Result: cv8a

Settings
# exclusive inclusive rows x rows loops node
1. 0.022 27.094 ↑ 1.0 48 1

Limit (cost=6,297.27..6,298.23 rows=48 width=73) (actual time=27.025..27.094 rows=48 loops=1)

2. 0.036 27.072 ↑ 10.4 48 1

Unique (cost=6,297.27..6,307.23 rows=498 width=73) (actual time=27.025..27.072 rows=48 loops=1)

3. 1.276 27.036 ↑ 10.4 48 1

Sort (cost=6,297.27..6,298.52 rows=498 width=73) (actual time=27.024..27.036 rows=48 loops=1)

  • Sort Key: spree_products.sales_global DESC, spree_products.id, spree_products.available_on, spree_products.updated_at, spree_products.consolidated_sales, spree_products.sales_br, spree_products.case_type_ids
  • Sort Method: quicksort Memory: 292kB
4. 1.395 25.760 ↓ 3.2 1,600 1

Nested Loop (cost=262.28..6,274.96 rows=498 width=73) (actual time=3.492..25.760 rows=1,600 loops=1)

5. 2.056 19.565 ↓ 1.9 1,600 1

Nested Loop (cost=261.99..5,800.18 rows=848 width=77) (actual time=3.482..19.565 rows=1,600 loops=1)

  • Join Filter: (spree_products.id = spree_variants.product_id)
6. 1.236 14.309 ↓ 1.8 1,600 1

Hash Join (cost=261.70..5,229.99 rows=910 width=77) (actual time=3.472..14.309 rows=1,600 loops=1)

  • Hash Cond: (spree_products.id = ps.product_id)
7. 9.640 9.640 ↑ 1.1 2,233 1

Seq Scan on spree_products (cost=0.00..4,946.63 rows=2,512 width=73) (actual time=0.027..9.640 rows=2,233 loops=1)

  • Filter: ((deleted_at IS NULL) AND (gift IS NOT TRUE) AND ((discontinue_on IS NULL) OR (discontinue_on >= '2019-11-07 11:05:11.28812'::timestamp without time zone)) AND (available_on <= '2019-11-07 11:05:11.288049'::timestamp without time zone) AND ((product_type_code)::text <> 'adapter'::text) AND ((product_type_code)::text = 'case'::text) AND (184 <> ALL (unsupported_case_device_ids)) AND (((product_type_code)::text <> 'case'::text) OR (1 = ANY (case_type_ids))))
  • Rows Removed by Filter: 10455
8. 1.286 3.433 ↓ 1.0 4,664 1

Hash (cost=204.25..204.25 rows=4,596 width=4) (actual time=3.432..3.433 rows=4,664 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 228kB
9. 2.147 2.147 ↓ 1.0 4,664 1

Seq Scan on spree_products_stores ps (cost=0.00..204.25 rows=4,596 width=4) (actual time=0.007..2.147 rows=4,664 loops=1)

  • Filter: (store_id = 3)
  • Rows Removed by Filter: 7020
10. 3.200 3.200 ↑ 1.0 1 1,600

Index Scan using idx_bruno_variant_master_spree on spree_variants (cost=0.29..0.61 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=1,600)

  • Index Cond: (product_id = ps.product_id)
11. 4.800 4.800 ↑ 1.0 1 1,600

Index Only Scan using idx_bruno_variant_price_spree on spree_prices (cost=0.29..0.55 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=1,600)

  • Index Cond: ((variant_id = spree_variants.id) AND (currency = 'EUR'::text))
  • Heap Fetches: 1326
Planning time : 0.943 ms
Execution time : 27.166 ms