explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Sfaa : final query

Settings
# exclusive inclusive rows x rows loops node
1. 627.239 660.545 ↑ 3.9 815 1

Nested Loop Left Join (cost=37.16..18,718.86 rows=3,165 width=63) (actual time=0.400..660.545 rows=815 loops=1)

  • Join Filter: (((custom_categories.ancestry)::text ~~* concat('%', custom_categories_1.id)) OR ((custom_categories.ancestry)::text = (custom_categories_1.id)::text))
  • Rows Removed by Join Filter: 663423
2. 0.652 0.706 ↓ 1.0 815 1

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

  • Recheck Cond: (site_id = 15)
  • Filter: (hidden IS FALSE)
  • Heap Blocks: exact=94
3. 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)
4. 32.227 32.600 ↓ 1.0 815 815

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

5. 0.330 0.373 ↓ 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.052..0.373 rows=815 loops=1)

  • Recheck Cond: (site_id = 15)
  • Heap Blocks: exact=94
6. 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)
Planning time : 0.258 ms
Execution time : 660.674 ms