Tac,
Saturday, August 17, 2002, 12:57:24 AM, you wrote:

T> A simple query in MySQL 4 that gets a count from 3 inner joined tables:

T>  select count(*) as C from quotes q inner join articles a using (article_id)
T> inner join media m using (media_id)

T> article_id and media_id are int(11), and are the primary keys for their
T> respective tables.  When used as foreign keys, they are also int(11), and
T> are indexed.  It's taking about 10 seconds to return the count, ~3000, from
T> tables that aren't all that big (quotes: 3000, articles: 100,000; media:
T> 1500).

T> I plan to use the new MySQL 4 row count feature soon, but the code I'm
T> working on needs to work on both MySQL 3 and 4 for now.

T> I believe that the query works significantly faster on MySQL 3.

T> Any ideas?

Could you show the output of EXPLAIN SELECT?





-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to