>>>>> "Ben-Nes" == Ben-Nes Michael <miki@stripped> writes:
Ben-Nes> when im querying
Ben-Nes> select distinct NASIDENTIFIER from ACCOUNTING;
Ben-Nes> from a table that have 75000 rows its take me 40 sec !!!
Ben-Nes> I don't have lots of experience so i don't know if this value is normal
Ben-Nes> or not.
Which MySQL version are you running? MySQL 3.22 (and below) is coded
to be able to handle DISTINCT of any size, but the code isn't that
fast in the case of only a few distinct values.
You can however tell MySQL that there the result will only contain a
few result rows with:
select SQL_SMALL_RESULT distinct NASIDENTIFIER from ACCOUNTING;
(This is probably faster in your case).
Another option is to upgrade to MySQL 3.23: DISTINCT and GROUP BY are
generally much faster in 3.23.