Skip to content
Advertisement

How to use ANALYZE EXPLAIN in a with_something query

I’m trying to find out how to use ANALYZE EXPLAIN on my PSQL query. If I add ANALYZE EXPLAIN SELECT, I get a syntax error. I have no clue how to use it.

I added the ANALYZE before the first and second SELECT, but both throw a syntax error.

I was unable to find different examples but on documentation, I should be able to do it on select or not.

The query

Advertisement

Answer

It’s explain (analyze) (or explain analyze) not “analyze explain”.

And this needs to go before the entire query, so before the WITH clause:

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement