explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8Lwd

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

HashAggregate (cost=675.68..675.69 rows=1 width=8) (actual time=6.838..6.838 rows=1 loops=1)

  • Group Key: count(DISTINCT product0_.id)
2. 0.011 6.834 ↑ 1.0 1 1

Aggregate (cost=675.67..675.68 rows=1 width=8) (actual time=6.834..6.834 rows=1 loops=1)

3. 0.008 6.823 ↓ 0.0 0 1

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

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

Hash Join (cost=13.49..672.91 rows=1 width=16) (actual time=0.731..6.785 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.633 3.633 ↓ 1.2 14,979 1

Seq Scan on product_detail productdet1_ (cost=0.00..614.23 rows=12,043 width=20) (actual time=0.007..3.633 rows=14,979 loops=1)

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

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
7. 0.014 0.057 ↑ 1.0 1 1

Bitmap Heap Scan on product product0_ (cost=9.46..13.48 rows=1 width=72) (actual time=0.054..0.057 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.043 ↓ 0.0 0 1

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

9. 0.015 0.015 ↓ 4.1 45 1

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

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

Bitmap Index Scan on product_sub_brand_idx (cost=0.00..4.84 rows=74 width=0) (actual time=0.023..0.023 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.004..0.015 rows=6 loops=2)

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