3 ms·
Between the request's query parameters and the query building, I added an optional SqlQueryOptimizer interface and injectable that's used for models/tables that
by karmakaze 4y ago
Between the request's query parameters and the query building, I added an optional SqlQueryOptimizer interface and injectable that's used for models/tables that need them. To minimize scope of writing each one, I made a sequential adapter that just tries each listed one until one applies. Each implementation first checks if the query params qualifies to use it, then makes any index hints or other query changes. Ended up doing this twice, once for ActiveRecord and once for an internal AST query builder.
- mplanchard 4y agoThis is a really stellar idea, thank you very much for sharing!