explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7YZH

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

Unique (cost=4,457.86..4,457.86 rows=1 width=8) (actual time=30.922..30.924 rows=1 loops=1)

2. 0.004 30.921 ↑ 1.0 1 1

Sort (cost=4,457.86..4,457.86 rows=1 width=8) (actual time=30.921..30.921 rows=1 loops=1)

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

Aggregate (cost=4,457.84..4,457.85 rows=1 width=8) (actual time=30.916..30.917 rows=1 loops=1)

4. 2.456 29.550 ↑ 1.4 3,407 1

Nested Loop (cost=1,578.18..4,446.26 rows=4,632 width=4) (actual time=3.892..29.550 rows=3,407 loops=1)

5. 1.424 22.894 ↑ 1.1 1,400 1

Nested Loop (cost=1,577.89..3,818.64 rows=1,535 width=12) (actual time=3.885..22.894 rows=1,400 loops=1)

6. 1.320 18.670 ↑ 1.1 1,400 1

Nested Loop (cost=1,577.61..3,091.77 rows=1,553 width=8) (actual time=3.878..18.670 rows=1,400 loops=1)

7. 4.035 13.189 ↑ 1.2 1,387 1

Hash Join (cost=1,577.32..2,138.78 rows=1,633 width=12) (actual time=3.869..13.189 rows=1,387 loops=1)

  • Hash Cond: (spree_variants.product_id = spree_products.id)
8. 5.308 5.308 ↓ 1.0 12,633 1

Seq Scan on spree_variants (cost=0.00..498.94 rows=12,318 width=8) (actual time=0.005..5.308 rows=12,633 loops=1)

  • Filter: ((is_master IS TRUE) AND (deleted_at IS NULL))
  • Rows Removed by Filter: 5062
9. 0.451 3.846 ↑ 1.2 1,387 1

Hash (cost=1,555.73..1,555.73 rows=1,727 width=4) (actual time=3.846..3.846 rows=1,387 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 65kB
10. 3.395 3.395 ↑ 1.2 1,387 1

Index Only Scan using id_bruno_products_list on spree_products (cost=0.41..1,555.73 rows=1,727 width=4) (actual time=0.026..3.395 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: 1520
11. 4.161 4.161 ↑ 1.0 1 1,387

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=1,387)

  • Index Cond: ((variant_id = spree_variants.id) AND (currency = 'BRL'::text))
  • Heap Fetches: 1379
12. 2.800 2.800 ↑ 1.0 1 1,400

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=1,400)

  • Index Cond: (spree_product_id = spree_variants.product_id)
  • Heap Fetches: 548
13. 4.200 4.200 ↑ 1.5 2 1,400

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=2 loops=1,400)

  • Index Cond: (product_id = spree_variants.product_id)
  • Heap Fetches: 2183
Planning time : 1.998 ms
Execution time : 30.991 ms