explain.depesz.com

PostgreSQL's explain analyze made readable

Result: rOGi

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 24.408 ↑ 1.0 1 1

Unique (cost=7,125.31..7,125.32 rows=1 width=8) (actual time=24.406..24.408 rows=1 loops=1)

2. 0.007 24.406 ↑ 1.0 1 1

Sort (cost=7,125.31..7,125.32 rows=1 width=8) (actual time=24.405..24.406 rows=1 loops=1)

  • Sort Key: (count(DISTINCT spree_products.id))
  • Sort Method: quicksort Memory: 25kB
3. 0.656 24.399 ↑ 1.0 1 1

Aggregate (cost=7,125.29..7,125.30 rows=1 width=8) (actual time=24.398..24.399 rows=1 loops=1)

4. 1.023 23.743 ↑ 1.5 1,547 1

Nested Loop (cost=291.37..7,119.37 rows=2,368 width=4) (actual time=5.296..23.743 rows=1,547 loops=1)

5. 0.884 20.540 ↑ 1.4 545 1

Nested Loop (cost=291.08..6,798.41 rows=785 width=16) (actual time=5.289..20.540 rows=545 loops=1)

6. 0.638 18.566 ↑ 1.5 545 1

Nested Loop (cost=290.79..6,426.78 rows=794 width=12) (actual time=5.282..18.566 rows=545 loops=1)

7. 0.476 16.293 ↑ 1.5 545 1

Nested Loop (cost=290.50..5,939.49 rows=835 width=16) (actual time=5.275..16.293 rows=545 loops=1)

  • Join Filter: (spree_products.id = spree_variants.product_id)
8. 0.804 14.182 ↑ 1.6 545 1

Hash Join (cost=290.21..5,465.67 rows=894 width=8) (actual time=5.263..14.182 rows=545 loops=1)

  • Hash Cond: (spree_products.id = ps.product_id)
9. 8.196 8.196 ↑ 1.2 1,387 1

Seq Scan on spree_products (cost=0.00..5,157.88 rows=1,727 width=4) (actual time=0.044..8.196 rows=1,387 loops=1)

  • Filter: ((deleted_at IS NULL) AND (discontinue_on IS NULL) AND (gift IS NOT TRUE) AND (available_on <= '2019-11-26 00:00:00'::timestamp without time zone) AND ((product_type_code)::text <> 'gift'::text) AND (10 <> ALL (unsupported_case_device_ids)) AND (1 = ANY (case_type_ids)))
  • Rows Removed by Filter: 11510
10. 2.241 5.182 ↑ 1.0 6,675 1

Hash (cost=206.72..206.72 rows=6,679 width=4) (actual time=5.182..5.182 rows=6,675 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 299kB
11. 2.941 2.941 ↑ 1.0 6,675 1

Seq Scan on spree_products_stores ps (cost=0.00..206.72 rows=6,679 width=4) (actual time=0.006..2.941 rows=6,675 loops=1)

  • Filter: (store_id = 1)
  • Rows Removed by Filter: 4823
12. 1.635 1.635 ↑ 1.0 1 545

Index Only Scan using idx_bruno_variants_listable on spree_variants (cost=0.29..0.52 rows=1 width=8) (actual time=0.002..0.003 rows=1 loops=545)

  • Index Cond: (product_id = ps.product_id)
  • Heap Fetches: 545
13. 1.635 1.635 ↑ 1.0 1 545

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

  • Index Cond: ((variant_id = spree_variants.id) AND (currency = 'BRL'::text))
  • Heap Fetches: 535
14. 1.090 1.090 ↑ 1.0 1 545

Index Only Scan using idx_bruno_product_translations_pt on spree_product_translations (cost=0.29..0.46 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=545)

  • Index Cond: (spree_product_id = spree_variants.product_id)
  • Heap Fetches: 255
15. 2.180 2.180 ↑ 1.0 3 545

Index Only Scan using index_spree_products_taxons_on_product_id on spree_products_taxons (cost=0.29..0.38 rows=3 width=4) (actual time=0.002..0.004 rows=3 loops=545)

  • Index Cond: (product_id = spree_variants.product_id)
  • Heap Fetches: 1096
Planning time : 3.278 ms
Execution time : 24.493 ms