List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:September 21 1999 8:26pm
Subject:RE: Re: Help with performance of this select statement:
View as plain text  
>>>>> "Bob" == Bob Kline <bkline@stripped> writes:

Bob> On Mon, 20 Sep 1999, Partha Dutta wrote:
>> Primary key information for the table.  Database_ID is int(11), and Account
>> is a varchar(12)
 

Bob> Well, clearly key_len [given by EXPLAIN SELECT as 4] doesn't mean what I
Bob> would have guessed it meant.  The manual simply says "The key_len column
Bob> indicates the length of the key that MySQL decided to use."  I'm going
Bob> to step back and let somewone from TcX explain what's going on.

Hi!

The 4 means that MySQL uses 4 bytes of the key (= the size of the
integer part) of the key to find the rows that matches

database_id = 0

In the query:

select * from b2cmr1 where database_id = 0 order by database_id, account;

MySQL should notice that we are using the 'Database_id' key to range
the find the matching rows and it should automaticly delete the ORDER
BY part.

The only way to find out what's going on is to compile MySQL with
--with-debug and generate a trace file when running this query.

Partha; Can you try to do a trace file and mail me everything between
the entry:

>mysql_select

and 

 >filesort

(+ the next 100 lines after filesort)

Regards,
Monty
Thread
Re: Re: Help with performance of this select statement:Partha Dutta20 Sep
  • Re: Re: Help with performance of this select statement:Bob Kline21 Sep
    • RE: Re: Help with performance of this select statement:Partha Dutta21 Sep
      • RE: Re: Help with performance of this select statement:Bob Kline21 Sep
        • RE: Re: Help with performance of this select statement:Michael Widenius22 Sep
          • RE: Re: Help with performance of this select statement:Partha Dutta23 Sep
  • Re: Re: Help with performance of this select statement:elble21 Sep