Comment by HighlandSpring
13 hours ago
Could you A/B at random, use that to collect data and eventually feed that back in to prefer A or B depending on the shape of the query?
13 hours ago
Could you A/B at random, use that to collect data and eventually feed that back in to prefer A or B depending on the shape of the query?
There are papers and Postgres projects that attempt this kind of learning-based optimization, with some success. None are in widespread use. (One part, but certainly not the entirety, of the problem is that it's not just A/B, it's an exponential number of options that all could seem close to each other.)
You can and some databases can do this (e.g. Oracle).
Customers love it when their queries sometimes run a lot longer.