explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7yoc : new query

Settings
# exclusive inclusive rows x rows loops node
1. 609.202 644.227 ↑ 3.9 815 1

Nested Loop Left Join (cost=37.16..21,859.11 rows=3,165 width=63) (actual time=0.322..644.227 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.752 0.795 ↓ 1.0 815 1

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

  • Recheck Cond: (site_id = 15)
  • Filter: (hidden IS FALSE)
  • Heap Blocks: exact=94
3. 0.043 0.043 ↓ 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.043..0.043 rows=815 loops=1)

  • Index Cond: (site_id = 15)
4. 33.944 34.230 ↓ 1.0 815 815

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

5. 0.252 0.286 ↓ 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.041..0.286 rows=815 loops=1)

  • Recheck Cond: (site_id = 15)
  • Heap Blocks: exact=94
6. 0.034 0.034 ↓ 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.034..0.034 rows=815 loops=1)

  • Index Cond: (site_id = 15)
Planning time : 0.201 ms
Execution time : 644.336 ms