Subject | Optimizing SELECT DISTINCT .. |
---|---|
Author | Harri Vartiainen |
Post date | 2009-02-03T11:11:18Z |
Hi,
What would be best way to optimize "SELECT DISTINCT FIELD1 FROM
TABLE1 ORDER BY FIELD1" query?
I have one table with about 200000 rows and 2000 distinct values,
query takes on production system 2-5 seconds, according to the query
plan the whole table is read. I have index defined on FIELD1, but it
doesn't help in this case.
I'm running FB 2.1.1
What would be best way to optimize "SELECT DISTINCT FIELD1 FROM
TABLE1 ORDER BY FIELD1" query?
I have one table with about 200000 rows and 2000 distinct values,
query takes on production system 2-5 seconds, according to the query
plan the whole table is read. I have index defined on FIELD1, but it
doesn't help in this case.
I'm running FB 2.1.1