This problem is paper-only - see explanation for the canonical SQL solution. The auto-grader checks your reasoning by asking you to return the recommended index column order for a given query.
You are given a query workload (a query string) and a set of available index hints. Return the best single composite index column order for the query as an array of column names.
Rule of thumb (Postgres / MySQL B-tree):
- Equality columns first (WHERE col = ?), then
- Range columns (WHERE col > ? / BETWEEN), then
- ORDER BY columns (only useful as the last segment if the prior segments are equalities).
- Selectivity matters: among equalities, put high-cardinality columns first.
For the auto-grader: parse the query into the structured { filters, ranges, orderBy } object passed in (already pre-parsed) and return an index column array.
Input shape: { equalities: string[], ranges: string[], orderBy: string[] }. Output: the column order.