List:General Discussion« Previous MessageNext Message »
From:js  Date:March 4 2007 7:08am
Subject:Re: A simple 2 table query gets very slow when using ORDER BY
View as plain text  
One thing I don't understand is what MySQL tried to do first.
Why did MySQL chose co.name as a key?

On 3/3/07, Filip Krejci <krejcif@stripped> wrote:
> > SELECT *
> > FROM employees2skills e2s FORCE INDEX (mod_time )
> >  INNER JOIN companies c ON c.id = e2s.co_id
> > ORDER BY e2s.mod_time limit 5;
> Yes, this query will be probably the best.
>
> This go through mod_time index (which is already sorted) from begin and
> try to join companies.
> When row count achieve limit, joining is stopped and result is send.
>
>
> --
> Filip Krejci <krejcif@stripped>
>
> LINUX-All you need
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql?unsub=1
>
>
Thread
A simple 2 table query gets very slow when using ORDER BYjs 3 Mar
  • Re: A simple 2 table query gets very slow when using ORDER BYjs 3 Mar
    • Re: A simple 2 table query gets very slow when using ORDER BYFilip Krejci3 Mar
      • Re: A simple 2 table query gets very slow when using ORDER BYjs 3 Mar
        • Re: A simple 2 table query gets very slow when using ORDER BYFilip Krejci3 Mar
          • Re: A simple 2 table query gets very slow when using ORDER BYjs 3 Mar
            • Re: A simple 2 table query gets very slow when using ORDER BYFilip Krejci3 Mar
              • Re: A simple 2 table query gets very slow when using ORDER BYjs 4 Mar
                • How do I alter the result of a selectBrian Menke8 Mar
                  • RE: How do I alter the result of a selectBrian Menke8 Mar
                  • Re: How do I alter the result of a selectDan Buettner8 Mar