I have a big table (61mil rows) that has an indexed not-null column
ID. I want to select the distinct values of that column. I expected the
select distinct id from bigtable ;
to run fast, making use of that index. Yet it takes more than 40sec to run on a fast server.
The EXPLAIN PLAN shows that a FAST FULL SCAN of that index takes place, whereas I'd expect a INDEX RANGE SCAN instead. The cost comes up as 93000.
Please advise. Do I perhaps need a different index type?