Hi!
I have a table with about 400k rows.
When I query this:
Code:
SELECT MIN(some_metrics) FROM big_table
everything is OK, execution time is about 0.02 sec.
But when I add a WHERE clause
Code:
SELECT MIN(some_metrics) FROM big_table WHERE parent_id = 10
this query executes in about 2 minutes. Indexes on parent_id and some_metrics columns are created.
The question is - how to speed up this query?