explain.depesz.com

PostgreSQL's explain analyze made readable

Result: W1yW

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 26.194 ↑ 1.0 1 1

Unique (cost=7,135.04..7,135.05 rows=1 width=8) (actual time=26.192..26.194 rows=1 loops=1)

2. 0.006 26.191 ↑ 1.0 1 1

Sort (cost=7,135.04..7,135.05 rows=1 width=8) (actual time=26.191..26.191 rows=1 loops=1)

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

Aggregate (cost=7,135.02..7,135.03 rows=1 width=8) (actual time=26.185..26.185 rows=1 loops=1)

4. 0.969 25.577 ↑ 1.5 1,547 1

Nested Loop (cost=291.37..7,129.10 rows=2,368 width=4) (actual time=4.740..25.577 rows=1,547 loops=1)

5. 0.841 22.428 ↑ 1.4 545 1

Nested Loop (cost=291.08..6,808.14 rows=785 width=16) (actual time=4.733..22.428 rows=545 loops=1)

6. 0.647 20.497 ↑ 1.5 545 1

Nested Loop (cost=290.79..6,436.51 rows=794 width=12) (actual time=4.726..20.497 rows=545 loops=1)

7. 0.678 18.215 ↑ 1.5 545 1

Nested Loop (cost=290.50..5,949.22 rows=835 width=16) (actual time=4.718..18.215 rows=545 loops=1)

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

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

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

Seq Scan on spree_products (cost=0.00..5,157.88 rows=1,727 width=4) (actual time=0.021..10.465 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. 1.995 4.632 ↑ 1.0 6,673 1

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

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

Seq Scan on spree_products_stores ps (cost=0.00..206.72 rows=6,679 width=4) (actual time=0.007..2.637 rows=6,673 loops=1)

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

Index Scan using index_spree_variants_on_product_id on spree_variants (cost=0.29..0.53 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=545)

  • Index Cond: (product_id = ps.product_id)
  • Filter: ((is_master IS TRUE) AND (deleted_at IS NULL))
  • Rows Removed by Filter: 0
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.129 ms
Execution time : 26.281 ms