Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

SQL problems... uses to much cpu on my hosting account...


Guest

Recommended Posts

i have been explained, that we have a big problem in this code, from my webhosting company.

 

# Time: 070919 22:45:42

# User@Host: elutstyr[elutstyr] @ ritz.domeneshop.no [194.63.248.43] # Query_time: 71 Lock_time: 0 Rows_sent: 6 Rows_examined: 6932778 select p.products_id, p.products_image from orders_products opa, orders_products opb, customers ca, customers cb, orders o, products p where opa.products_id = '1199' and ca.customers_id = cb.customers_id and opb.products_id != '1199' and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = '1' group by p.products_id order by o.date_purchased desc limit 6; # Time: 070919 22:45:46 # User@Host: elutstyr[elutstyr] @ ritz.domeneshop.no [194.63.248.43] # Query_time: 184 Lock_time: 0 Rows_sent: 6 Rows_examined: 17291763 select p.products_id, p.products_image from orders_products opa, orders_products opb, customers ca, customers cb, orders o, products p where opa.products_id = '1839' and ca.customers_id = cb.customers_id and opb.products_id != '1839' and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = '1' group by p.products_id order by o.date_purchased desc limit 6; # Time: 070919 22:46:07 # User@Host: elutstyr[elutstyr] @ ritz.domeneshop.no [194.63.248.43] # Query_time: 106 Lock_time: 0 Rows_sent: 6 Rows_examined: 17291763 select p.products_id, p.products_image from orders_products opa, orders_products opb, customers ca, customers cb, orders o, products p where opa.products_id = '1839' and ca.customers_id = cb.customers_id and opb.products_id != '1839' and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = '1' group by p.products_id order by o.date_purchased desc limit 6; # Time: 070919 22:46:53 # User@Host: elutstyr[elutstyr] @ ritz.domeneshop.no [194.63.248.43] # Query_time: 17 Lock_time: 0 Rows_sent: 6 Rows_examined: 3469191 select p.products_id, p.products_image from orders_products opa, orders_products opb, customers ca, customers cb, orders o, products p where opa.products_id = '1920' and ca.customers_id = cb.customers_id and opb.products_id != '1920' and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = '1' group by p.products_id order by o.date_purchased desc limit 6;

 

it seems like the database is not good enough optimized.... and i dont know ho to contact, og what to do... every hour that goes by, i will loose money... so please... can anyone help me...

 

i believe i need some codefix or update.... there must have been other people having this problems?

 

thanx

Link to comment
Share on other sites

i have been explained, that we have a big problem in this code, from my webhosting company.

 

# Time: 070919 22:45:42

# User@Host: elutstyr[elutstyr] @ ritz.domeneshop.no [194.63.248.43] # Query_time: 71 Lock_time: 0 Rows_sent: 6 Rows_examined: 6932778 select p.products_id, p.products_image from orders_products opa, orders_products opb, customers ca, customers cb, orders o, products p where opa.products_id = '1199' and ca.customers_id = cb.customers_id and opb.products_id != '1199' and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = '1' group by p.products_id order by o.date_purchased desc limit 6;

 

it seems like the database is not good enough optimized....

Seems like you use a modified also_purchased_products.php because customers ca, customers cb and and ca.customers_id = cb.customers_id are not in the standard osC module whereas the rest of the query is.

 

To me the problem seems to be that missing in this query is and cb.customers_id = o.customers_id and that is probably causing the large amount of rows that need to be examined.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...