|
|
|
|
|
by cogman10
268 days ago
|
|
> Has anyone put machine learning in an SQL query optimizer yet? Yes, I think everyone has? At very least I know that MSSQL has because we semi regularly run into problems with it :). MSSQL keeps track of query statistics and uses those in future planning. SOMETIMES it just so happens that the optimization for the general case makes the outlier 100x slower which kills general performance. |
|
However, it was also much more likely to hit an AWFUL pathological case which completely wrecked the performance as you describe. Combined with pessimistic locking, we ended up with far more overnight support calls from the MSSQL backend than from the PGSQL backend. Usually because it suddenly decided to switch query plan at 1AM.
I wonder if there's a trade-off where an optimizer produces better average query plans but worse outliers.