I have the following query:
select distinct type, account
from balances_tbl
where month = 'DEC-12'
The table balances_tbl
has over 3 million records per month. The distinct type and account rows are maybe around 20,000 records. The month
column is indexed. The type
and account
columns are also indexed. The query takes a really long time (about 30 minutes) to execute.
Is there a way to make this query with the DISTINCT
clause faster?