This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

database indexing
#1

Hi 
I recently had a message from my server support team that my site was generatin slow mySQL queries. it turned out the worst culprit was the basic commentics query 
'SELECT * FROM `pages` WHERE `identifier` = 'ntax_cenozoicIsochrysis nuda' AND `site_id` = '1'
my site now has tens of thousands of pages, each with a comments area, so since the pages table did not have any indices the search was slow.  
I have now added an index and that should solve the problem but I thought it might be useful to let you know about the issue.
Maybe the indices were missing because my installation went wrong, but if not it might be a good idea to change the installation so that the pages table has an index on the identifier column.
cheers 
Jeremy
Reply
#2

Hi Jeremy, I really appreciate this, I'll add an index in the next version (due in the next month or two).

Have you completed the interview?
Reply
#3

Which columns did you add an index on? Was it identifier and site_id?

Have you completed the interview?
Reply
#4

If so, did you add them as two separate indexes or a composite index?

I'm thinking of adding a composite one like this:
Code:
ALTER TABLE `pages` ADD INDEX idx_identifier_site_id (`identifier`(200), `site_id`);

Have you completed the interview?
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by vsantini
05-May-2012, 11:58 PM
Last Post by Norbs
14-Jun-2011, 05:21 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)