On Jun 20, 2004, at 9:07 PM, Darren Duncan wrote:
Generally speaking, you should only use indexes on table columns that have a lot of distinct values, and each one only appears a few times. You should not use indexes on columns that have few distinct values and each appears many times; in the latter case, a full table scan would be faster.
That's weird. I would have thought that having any index at all to pare down the result set would make things faster..? Wouldn't the select here:
CREATE TABLE tmp ( flag boolean, name text );
SELECT name FROM tmp WHERE flag = 1 AND name LIKE '%foo%';
run faster with an index on the flag column since it can scan just the flag = 1 rows instead of the full table?
-Dave
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]