explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Id5u

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 18.292 ↑ 1.0 1 1

Unique (cost=3,243.41..3,243.42 rows=1 width=8) (actual time=18.290..18.292 rows=1 loops=1)

2. 0.005 18.288 ↑ 1.0 1 1

Sort (cost=3,243.41..3,243.42 rows=1 width=8) (actual time=18.288..18.288 rows=1 loops=1)

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

Aggregate (cost=3,243.39..3,243.40 rows=1 width=8) (actual time=18.282..18.283 rows=1 loops=1)

4. 1.266 17.601 ↑ 1.5 1,547 1

Nested Loop (cost=1,334.49..3,237.47 rows=2,368 width=4) (actual time=4.374..17.601 rows=1,547 loops=1)

5. 0.592 14.700 ↑ 1.4 545 1

Nested Loop (cost=1,334.20..2,916.51 rows=785 width=16) (actual time=4.367..14.700 rows=545 loops=1)

6. 0.512 13.018 ↑ 1.5 545 1

Nested Loop (cost=1,333.91..2,544.88 rows=794 width=12) (actual time=4.360..13.018 rows=545 loops=1)

7. 0.388 10.871 ↑ 1.5 545 1

Nested Loop (cost=1,333.62..2,057.59 rows=835 width=16) (actual time=4.353..10.871 rows=545 loops=1)

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

Hash Join (cost=1,333.33..1,574.04 rows=894 width=8) (actual time=4.337..8.848 rows=545 loops=1)

  • Hash Cond: (ps.product_id = spree_products.id)
9. 2.546 2.546 ↑ 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.009..2.546 rows=6,673 loops=1)

  • Filter: (store_id = 1)
  • Rows Removed by Filter: 4823
10. 0.531 4.315 ↑ 1.2 1,387 1

Hash (cost=1,311.74..1,311.74 rows=1,727 width=4) (actual time=4.314..4.315 rows=1,387 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 65kB
11. 3.784 3.784 ↑ 1.2 1,387 1

Index Only Scan using id_bruno_products_list on spree_products (cost=0.41..1,311.74 rows=1,727 width=4) (actual time=0.021..3.784 rows=1,387 loops=1)

  • Index Cond: (available_on <= '2019-11-26 00:00:00'::timestamp without time zone)
  • Filter: ((10 <> ALL (unsupported_case_device_ids)) AND (1 = ANY (case_type_ids)))
  • Rows Removed by Filter: 4494
  • Heap Fetches: 759
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.002..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. 1.635 1.635 ↑ 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.003 rows=3 loops=545)

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