1

My Sub Domain Magento Site /market is taking a full min to load up.

Upon careful scrutiny of Slow Query Log File provided by Webhost, there's one query that is taking a whopping 50 secs., details below,.

SELECT * FROM `sangyugk_sm_market_quickstart`.`catalog_product_index_price_idx`;
# Time: 160204 1:13:00
# User@Host: sangyugk[sangyugk] @ localhost []
# Thread_id: 592321 Schema: Last_errno: 1160 Killed: 0
# Query_time: 50.489651 Lock_time: 0.000041 Rows_sent: 228858 Rows_examined: 228858 Rows_affected: 0 Rows_read: 228858
# Bytes_sent: 3439001

Any thoughts or comments from more experienced Magento Techies ?

Could this be the query resulting on slow load up ?

There are other numerous Slow Queries that take 5 secs +, but this one caught my attention.

Pls help..

2 Answers 2

0

Yes...60 secs is a lot...This is because you are reading 228858 rows from the database. Normally you will set a limit and a limitstart to get only selected records that are required. Not more. but this seems to be a bug.

you need optimize the query...or try indexing the tables to optimize load time.

2
  • thanks for info. should i contact the Theme developer about this suspect query ? I questioned the Webhost, they it select query that reviews the contents of the catalog_product_index_price_idx table - whatever that means..
    – Mave
    Feb 12, 2016 at 9:55
  • what about the other multiple queries that are 5 sec + & more,,,do they all amalgamate together to delay initial site load up ?
    – Mave
    Feb 12, 2016 at 10:36
0

Yes... you should contact the developer to rewrite the query.

In the query there is select "*". * means querying all the fields.. Avoid * as it is very database intensive process. Instead use only the required field names. Also instead of querying ALL the results, they should query only a limited records and use a loop to do the rest.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.