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

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

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

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

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

Any ideas?

Thx,

Tac


---------------------------------------------------------------------
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