explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Pbig

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.321 853.673 ↑ 3.7 193 1

Sort (cost=33,713.11..33,714.90 rows=714 width=8) (actual time=853.657..853.673 rows=193 loops=1)

  • Sort Key: b.name
  • Sort Method: quicksort Memory: 34kB
2. 34.060 853.352 ↑ 3.7 193 1

HashAggregate (cost=33,672.13..33,679.27 rows=714 width=8) (actual time=853.317..853.352 rows=193 loops=1)

3. 26.541 819.292 ↑ 1.1 142,162 1

Nested Loop (cost=73.48..33,285.49 rows=154,654 width=8) (actual time=2.776..819.292 rows=142,162 loops=1)

4. 0.558 4.581 ↑ 1.3 293 1

Hash Join (cost=73.05..488.72 rows=385 width=24) (actual time=2.098..4.581 rows=293 loops=1)

  • Hash Cond: (fbq.brand_id = b.id)
5. 2.513 2.513 ↑ 1.3 638 1

Index Scan using idx_firm_brand_quality_firm_id on firm_brand_quality fbq (cost=0.44..409.09 rows=846 width=8) (actual time=0.562..2.513 rows=638 loops=1)

  • Index Cond: (firm_id = 40528::bigint)
6. 0.068 1.510 ↑ 2.4 293 1

Hash (cost=63.69..63.69 rows=714 width=16) (actual time=1.510..1.510 rows=293 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
7. 1.442 1.442 ↑ 2.4 293 1

Seq Scan on brand b (cost=0.00..63.69 rows=714 width=16) (actual time=0.037..1.442 rows=293 loops=1)

  • Filter: (active AND has_stock)
  • Rows Removed by Filter: 345
8. 788.170 788.170 ↑ 1.0 485 293

Index Scan using idx_product_brand_id on product p (cost=0.42..80.26 rows=493 width=8) (actual time=1.071..2.690 rows=485 loops=293)

  • Index Cond: (brand_id = fbq.brand_id)
  • Filter: ((dtype)::text = 'ProductTyre'::text)
  • Rows Removed by Filter: 682