0

I read with interest about postgres' genetic query optimiser. Is this enabled by default? Is there a setting to enable it? Are there good rules of thumb of when to use it versus when now?

Doc link follows:

https://www.postgresql.org/docs/11/geqo.html

0

1 Answer 1

0

The configuration for the genetic optimizer is documented in the chapter "Query Planning" of the manual. Specifically the section Genetic Query Optimizer

The first configuration parameter that is listed there is:

geqo (boolean)

Enables or disables genetic query optimization. This is on by default. It is usually best not to turn it off in production; the geqo_threshold variable provides more granular control of GEQO.

(emphasis mine)

So whenever you run a query that has more tables in the FROM clause than specified by geqo_threshold, GEQO will be used.

If you want to see the effects of it, you could lower that value and compare those plans against plans done without it.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.