explain.depesz.com

PostgreSQL's explain analyze made readable

Result: oKLB : old query

Settings
# exclusive inclusive rows x rows loops node
1. 1,740.744 53,817.258 ↑ 177.5 2,716 1

Gather (cost=1,000.00..3,053,162.67 rows=482,041 width=63) (actual time=26.329..53,817.258 rows=2,716 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
2. 46,356.121 52,076.514 ↑ 208.8 1,358 2 / 2

Nested Loop Left Join (cost=0.00..3,003,958.57 rows=283,554 width=63) (actual time=15.625..52,076.514 rows=1,358 loops=2)

  • 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: 49339564
3. 10.096 10.096 ↑ 1.1 408 2 / 2

Parallel Seq Scan on custom_categories (cost=0.00..2,802.31 rows=465 width=57) (actual time=0.052..10.096 rows=408 loops=2)

  • Filter: ((hidden IS FALSE) AND (site_id = 15))
  • Rows Removed by Filter: 60134
4. 5,710.297 5,710.297 ↑ 1.0 121,082 815 / 2

Seq Scan on custom_categories custom_categories_1 (cost=0.00..3,122.82 rows=121,082 width=29) (actual time=0.005..14.013 rows=121,082 loops=815)

Planning time : 0.227 ms
Execution time : 53,817.998 ms