1

I have come across the need to totally disable PostgreSQL query optimization just so that I can measure the effectiveness of applying QO (I want to see a before and after). I have come across this topic How to disable all optimizations of PostgreSQL from 2014 which basically says it's not possible. I wonder if anything has changed since then? I would really like to see a bad plan vs good plan scenario with a dramatic difference.

1 Answer 1

3

You can't execute a query without a plan, and the optimizer is what comes up with the plan. There is no "default" plan which would exist in the absence of the optimizer.

You turn all the enable_* parameters to off, except for enable_seqscan and enable_nestloop.

Or you could set join_collapse_limit and from_collapse_limit both 1, that would severely constrain what the optimizer can do.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.