MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Tac Date:August 16 2002 9:57pm
Subject:slow query in MySQL 4
View as plain text  
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:

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?



slow query in MySQL 4Tac17 Aug
  • Re: slow query in MySQL 4Egor Egorov17 Aug
  • Re: slow query in MySQL 4Tac19 Aug