Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Mar 2009
    Posts
    609
    Plugin Contributions
    0

    Default Joins performed without indexes

    My dedicated server is being slow, and we are investigating the root cause of the issue.

    The largest problem I am seeing is there are hundreds of thousand of sql joins without indexes. This is the largest consumer of CPU cycles that I can see on your SQL server. In the past 24 hours your MySQL server has nearly 100K of them.

    Joins performed without indexes: 93396

    This is the first and for most issue that you you need to solve, as these are killing the performance of your server.
    What tables don't use indexes?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,380
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Joins performed without indexes

    Quote Originally Posted by DigitalShadow View Post
    What tables don't use indexes?
    Very few. If your site's database hasn't been altered from original ZC implementation, then most tables will have well-performing indexes.


    But, without a list of the specific queries they say ought to have joins, it's nearly impossible to do anything meaningful with their feedback.
    And, they're probably only looking at some analysis panel and not at any actual queries ... so those numbers might mean nothing at all.

    Ask them to quote the top 10 unique queries demonstrating the problem so we can investigate.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Mar 2009
    Posts
    609
    Plugin Contributions
    0

    Default Re: Joins performed without indexes

    Quote Originally Posted by DrByte View Post
    Ask them to quote the top 10 unique queries demonstrating the problem so we can investigate.
    Can I find this information, is there a logging script that could be used?

  4. #4
    Join Date
    Jan 2004
    Posts
    66,380
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Joins performed without indexes

    Quote Originally Posted by DigitalShadow View Post
    Can I find this information, is there a logging script that could be used?
    Chances are they've configured MySQL to "log any slow queries" and also to "log any queries which don't use indexes". Those are settings the server administrator can set server-wide, and the output gets dumped into text files on the server, which usually only the server administrator has access to. But they could share that data with you if they're willing. (Sometimes they won't because the logs might contain data from other sites on the server too, and they don't want to go to the trouble of stripping out only your data for you because that takes time on their part.)

    And they might not want to have to package up a huge file storing 93396 queries for you to have to download ... besides, there's probably a lot of duplicates in it and that's too much data for you to go through anyway. That's why I asked for the top 10 unique ones.

    But you can ask.


    They might also be using some advanced tools to perform additional analysis on the logged data. Whether they have any extra information to share with you is unknown to you or me.


    Your server might also be slow because of PHP errors ... which Zen Cart stores in the /logs/ folder: http://www.zen-cart.com/content.php?124-blank-page
    If your server is generating logs on each page-click, then you really need to fix those first, as every error slows the site down.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Mar 2009
    Posts
    609
    Plugin Contributions
    0

    Default Re: Joins performed without indexes

    The server is mine, so nothing to worry about in regards to other data.

    I keep an eye on the log folder, nothing in there to report.

    The hosting company are amazing, we have been working on this issue for a while. We are looking to exhaust all options to get the site running as well as it can, I am upgrading the hardware, but if we can improve the code as well, then a benefit can be had there too.

    I will get back to you with more information.

  6. #6
    Join Date
    Jan 2004
    Posts
    66,380
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Joins performed without indexes

    It could be that you've got plugins installed that have added tables which aren't properly indexed.

    Also, as a diagnostic step to compare your site against original ZC db schema, you could export your table structures using phpMyAdmin and compare those against the original ZC install sql.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Mar 2009
    Posts
    609
    Plugin Contributions
    0

    Default Re: Joins performed without indexes

    Did you see the PM I sent you?

    There was one error in there that might be related to that issue I mentioned in the paypal error thread, I have posted in that thread.

    The other errors I sent you, did anything look odd?

  8. #8
    Join Date
    Jan 2004
    Posts
    66,380
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Joins performed without indexes

    I've replied to the PayPal thread. Your database content is still latin1 format, and needs upgrading to utf8. Follow the steps here: http://www.zen-cart.com/content.php?...8859-1-to-utf8
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    Mar 2009
    Posts
    609
    Plugin Contributions
    0

    Default Re: Joins performed without indexes

    That is done, I presume this wouldn't have caused the joins without indexes problem.

  10. #10
    Join Date
    Aug 2009
    Location
    North Idaho, USA
    Posts
    2,008
    Plugin Contributions
    1

    Default Re: Joins performed without indexes

    Quote Originally Posted by DigitalShadow View Post
    My dedicated server is being slow, and we are investigating the root cause of the issue.

    What tables don't use indexes?
    I'm also seeing this on our server and have requested the top 10 unique queries as suggested by DrByte.



    100,000 per day average: You probably have a lot of queries that require MySQL to scan whole tables or you have joins that don't use keys properly.
    15M per day average: your tables are not properly indexed or that your queries are not written to take advantage of the indexes you have.
    Rick
    RixStix (dot) com
    aka: ChainWeavers (dot) com

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Being notified when a new customer joins website?
    By tjturner in forum General Questions
    Replies: 2
    Last Post: 14 Jul 2011, 06:47 AM
  2. 2 Seperate Indexes?
    By CnTGifts in forum General Questions
    Replies: 4
    Last Post: 22 Mar 2008, 07:49 PM
  3. drop down menu & table joins
    By MFP in forum General Questions
    Replies: 1
    Last Post: 9 Jul 2006, 10:08 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR