explain.depesz.com

PostgreSQL's explain analyze made readable

Result: foxs

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

Unique (cost=9,655.89..9,655.89 rows=1 width=8) (actual time=78.038..78.039 rows=1 loops=1)

2. 0.005 78.037 ↑ 1.0 1 1

Sort (cost=9,655.89..9,655.89 rows=1 width=8) (actual time=78.037..78.037 rows=1 loops=1)

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

Aggregate (cost=9,655.87..9,655.88 rows=1 width=8) (actual time=78.031..78.032 rows=1 loops=1)

4. 5.803 73.541 ↓ 2.0 11,694 1

Nested Loop (cost=5,266.94..9,641.01 rows=5,944 width=4) (actual time=22.425..73.541 rows=11,694 loops=1)

5. 3.360 56.810 ↓ 1.4 2,732 1

Nested Loop (cost=5,266.65..8,837.76 rows=1,964 width=16) (actual time=22.415..56.810 rows=2,732 loops=1)

6. 1.858 42.522 ↓ 1.4 2,732 1

Nested Loop (cost=5,266.36..6,672.86 rows=1,996 width=12) (actual time=22.402..42.522 rows=2,732 loops=1)

7. 4.616 32.468 ↓ 1.3 2,732 1

Hash Join (cost=5,266.07..5,832.22 rows=2,138 width=16) (actual time=22.388..32.468 rows=2,732 loops=1)

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

Seq Scan on spree_variants (cost=0.00..498.46 rows=12,279 width=8) (actual time=0.006..5.487 rows=12,595 loops=1)

  • Filter: ((is_master IS TRUE) AND (deleted_at IS NULL))
  • Rows Removed by Filter: 5061
9. 0.928 22.365 ↓ 1.2 2,732 1

Hash (cost=5,237.43..5,237.43 rows=2,291 width=8) (actual time=22.365..22.365 rows=2,732 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 139kB
10. 2.453 21.437 ↓ 1.2 2,732 1

Hash Join (cost=295.69..5,237.43 rows=2,291 width=8) (actual time=4.572..21.437 rows=2,732 loops=1)

  • Hash Cond: (spree_products.id = ps.product_id)
11. 14.453 14.453 ↓ 1.2 5,132 1

Seq Scan on spree_products (cost=0.00..4,897.51 rows=4,265 width=4) (actual time=0.010..14.453 rows=5,132 loops=1)

  • Filter: ((deleted_at 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 (((product_type_code)::text <> 'case'::text) OR (1 = ANY (case_type_ids))))
  • Rows Removed by Filter: 7727
12. 1.981 4.531 ↑ 1.0 6,893 1

Hash (cost=209.35..209.35 rows=6,907 width=4) (actual time=4.531..4.531 rows=6,893 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 307kB
13. 2.550 2.550 ↑ 1.0 6,893 1

Seq Scan on spree_products_stores ps (cost=0.00..209.35 rows=6,907 width=4) (actual time=0.009..2.550 rows=6,893 loops=1)

  • Filter: (store_id = 1)
  • Rows Removed by Filter: 4815
14. 8.196 8.196 ↑ 1.0 1 2,732

Index Only Scan using idx_bruno_variant_price_spree on spree_prices (cost=0.29..0.38 rows=1 width=4) (actual time=0.002..0.003 rows=1 loops=2,732)

  • Index Cond: ((variant_id = spree_variants.id) AND (currency = 'BRL'::text))
  • Heap Fetches: 2301
15. 10.928 10.928 ↑ 1.0 1 2,732

Index Scan using index_spree_product_translations_on_spree_product_id on spree_product_translations (cost=0.29..1.07 rows=1 width=4) (actual time=0.003..0.004 rows=1 loops=2,732)

  • Index Cond: (spree_product_id = spree_variants.product_id)
  • Filter: ((locale)::text = 'pt-BR'::text)
  • Rows Removed by Filter: 3
16. 10.928 10.928 ↓ 1.3 4 2,732

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=4 loops=2,732)

  • Index Cond: (product_id = spree_variants.product_id)
  • Heap Fetches: 8082
Planning time : 2.860 ms
Execution time : 78.126 ms