3 ms·
My god, the table join optimizer can use a genetic algorithm. Fascinating. I would not have thought an SQL database would have a need for such an algorithm!
by etaioinshrdlu 8y ago
My god, the table join optimizer can use a genetic algorithm. Fascinating. I would not have thought an SQL database would have a need for such an algorithm!
- jdnier 8y agohttps://wiki.postgresql.org/wiki/Backend_flowchart#optimizer_geqo https://wiki.postgresql.org/wiki/Backend_flowchart#optimizer... Genetic query optimizer optimizer/path evaluates all possible ways to join the requested tables. When the number of tables becomes great, the number of tests made becomes great too. The Genetic Query Optimizer considers each table separately, then figures the most optimal order to perform the join. For a few tables, this method takes longer, but for a large number of tables, it is faster. There is an option to control when this feature is used.
- atombender 8y agoThe default setting has the GA planner only kick in when you combine more than 12 tables in a select, if I remember correctly. This is because it's always slower than the standard cost-based planner.