explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2eTL

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 6.944 ↑ 1.0 1 1

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

  • Group Key: count(DISTINCT product0_.id)
2. 0.050 6.938 ↑ 1.0 1 1

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

3. 0.010 6.888 ↓ 0.0 0 1

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

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

Hash Join (cost=13.49..672.91 rows=1 width=16) (actual time=0.742..6.844 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.543 3.543 ↓ 1.2 14,979 1

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

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

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
7. 0.017 0.114 ↑ 1.0 1 1

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

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

9. 0.023 0.023 ↓ 4.1 45 1

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

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

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

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

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

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