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:
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:
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; thegeqo_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.