Subject Re: [ib-support] Select count(*) slow even with index?
Author Georg Schäfer
Helen wrote:

> >A normal index is created on FOLDER_ID. There aren't many FOLDER_ID
> >values
> >around
> >(probably about 10), so I'm not sure if indexing this field is a good
> >idea. (Is it?).
> Probably not. You would likely be better to remove that index and
> it with one on (FOLDER_ID,PRI_KEY) to improve the selectivity.

Of course, that would improve selectivity. But would it change the amount
of work for the engine to do?
I would think that it points the optimizer towards using this index instead
of possible others, but I don't expect increasing performance, since the
engine still has to walk through the same number of records.

Or am I wrong?