explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ToO6 : Optimization for: plan #PvCj

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 631.901 668.550 ↑ 3.9 815 1

Nested Loop Left Join (cost=37.16..21,859.11 rows=3,165 width=63) (actual time=0.409..668.550 rows=815 loops=1)

  • Join Filter: (((custom_categories.ancestry)::text ~~* ('%'::text || (custom_categories_1.id)::text)) OR ((custom_categories.ancestry)::text = (custom_categories_1.id)::text))
  • Rows Removed by Join Filter: 663423
2. 0.741 0.789 ↓ 1.0 815 1

Bitmap Heap Scan on custom_categories (cost=18.58..1,503.85 rows=790 width=57) (actual time=0.062..0.789 rows=815 loops=1)

  • Recheck Cond: (site_id = 15)
  • Filter: (hidden IS FALSE)
  • Heap Blocks: exact=94
3. 0.048 0.048 ↓ 1.0 815 1

Bitmap Index Scan on index_custom_categories_on_site_id (cost=0.00..18.38 rows=795 width=0) (actual time=0.048..0.048 rows=815 loops=1)

  • Index Cond: (site_id = 15)
4. 35.511 35.860 ↓ 1.0 815 815

Materialize (cost=18.58..1,507.83 rows=795 width=29) (actual time=0.000..0.044 rows=815 loops=815)

5. 0.295 0.349 ↓ 1.0 815 1

Bitmap Heap Scan on custom_categories custom_categories_1 (cost=18.58..1,503.86 rows=795 width=29) (actual time=0.081..0.349 rows=815 loops=1)

  • Recheck Cond: (site_id = 15)
  • Heap Blocks: exact=94
6. 0.054 0.054 ↓ 1.0 815 1

Bitmap Index Scan on index_custom_categories_on_site_id (cost=0.00..18.38 rows=795 width=0) (actual time=0.054..0.054 rows=815 loops=1)

  • Index Cond: (site_id = 15)
Planning time : 0.231 ms
Execution time : 668.667 ms