List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:September 17 1999 7:31pm
Subject:Is it Normal ?
View as plain text  
>>>>> "Ben-Nes" == Ben-Nes Michael <miki@stripped> writes:

Ben-Nes> Hi
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.

Hi!

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.

Regards,
Monty
Thread
Is it Normal ?Ben-Nes Michael15 Sep
  • RE: Is it Normal ?Erhhung Yuan15 Sep
    • Re: Is it Normal ?Ben-Nes Michael15 Sep
      • Re: Is it Normal ?Bob Kline15 Sep
    • Re: Is it Normal ?Ben-Nes Michael15 Sep
  • Re: Is it Normal ?Ben-Nes Michael15 Sep
    • Re: Is it Normal ?Matthias Urlichs15 Sep
      • Re: Is it Normal ?Paul DuBois15 Sep
        • Re: Is it Normal ?Matthias Urlichs15 Sep
          • Re: Is it Normal ?Michael Widenius17 Sep
  • Re: Is it Normal ?Bob Kline15 Sep
  • Is it Normal ?Michael Widenius17 Sep
Re: Is it Normal ?Richard Ellerbrock15 Sep