Level 9 - DistinguishedOptimization Questionsm2 storage index mvcc internals
Optimization: Composite Index Column Order
Choose the better index-aligned query shape for WHERE tenant_id = ? AND status = ? ORDER BY created_at DESC LIMIT 100. Query A: SELECT order_id, created_at FROM orders WHERE status = 'PAID' AND tenant_id = 55 ORDER BY created_at DESC LIMIT 100; Query B: SELECT order_id, created_at FROM orders WHERE tenant_id = 55 AND status = 'PAID' ORDER BY created_at DESC LIMIT 100;