explain.depesz.com

PostgreSQL's explain analyze made readable

Result: sQ7y

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 7.520 ↑ 1.0 1 1

HashAggregate (cost=681.58..681.59 rows=1 width=8) (actual time=7.520..7.520 rows=1 loops=1)

  • Group Key: count(DISTINCT product0_.id)
2. 0.017 7.515 ↑ 1.0 1 1

Aggregate (cost=681.57..681.58 rows=1 width=8) (actual time=7.515..7.515 rows=1 loops=1)

3. 0.010 7.498 ↓ 0.0 0 1

Nested Loop (cost=13.49..681.57 rows=1 width=8) (actual time=7.498..7.498 rows=0 loops=1)

  • Join Filter: (product0_.manufacturer_id = manufactur2_.id)
  • Rows Removed by Join Filter: 12
4. 3.391 7.458 ↓ 2.0 2 1

Hash Join (cost=13.49..678.80 rows=1 width=16) (actual time=0.898..7.458 rows=2 loops=1)

  • Hash Cond: (productdet1_.product_id = product0_.id)
  • Join Filter: ((lower((product0_.name)::text) ~~ '%%'::text) OR (lower((product0_.code)::text) ~~ '%%'::text) OR (lower((productdet1_.barcode)::text) ~~ '%%'::text))
5. 3.958 3.958 ↓ 1.2 14,979 1

Seq Scan on product_detail productdet1_ (cost=0.00..619.10 rows=12,317 width=20) (actual time=0.012..3.958 rows=14,979 loops=1)

  • Filter: (enabled AND (NOT is_deleted))
  • Rows Removed by Filter: 6444
6. 0.005 0.109 ↑ 1.0 1 1

Hash (cost=13.48..13.48 rows=1 width=72) (actual time=0.109..0.109 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
7. 0.034 0.104 ↑ 1.0 1 1

Bitmap Heap Scan on product product0_ (cost=9.46..13.48 rows=1 width=72) (actual time=0.095..0.104 rows=1 loops=1)

  • Recheck Cond: ((brand_id = 1151) AND (sub_brand_id = 1211))
  • Filter: (enabled AND (NOT is_deleted) AND (distributor_id = 8) AND (category_id = 215))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=5
8. 0.005 0.070 ↓ 0.0 0 1

BitmapAnd (cost=9.46..9.46 rows=1 width=0) (actual time=0.070..0.070 rows=0 loops=1)

9. 0.034 0.034 ↓ 4.1 45 1

Bitmap Index Scan on product_brand_idx (cost=0.00..4.37 rows=11 width=0) (actual time=0.034..0.034 rows=45 loops=1)

  • Index Cond: (brand_id = 1151)
10. 0.031 0.031 ↓ 2.1 158 1

Bitmap Index Scan on product_sub_brand_idx (cost=0.00..4.84 rows=74 width=0) (actual time=0.031..0.031 rows=158 loops=1)

  • Index Cond: (sub_brand_id = 1211)
11. 0.030 0.030 ↑ 1.0 6 2

Seq Scan on manufacturer manufactur2_ (cost=0.00..2.69 rows=6 width=8) (actual time=0.005..0.015 rows=6 loops=2)

  • Filter: ((code)::text = 'PG'::text)
  • Rows Removed by Filter: 57
Planning time : 1.307 ms
Execution time : 7.617 ms