Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Speed improvement of category product count


Spaceboy

Recommended Posts

Posted

I like the category product count but I know that it slows down a lot the shop. The SQL requests are a bit stupid. For each category a count(*) is done. Nota good technical solution.

 

Why not create a table for storing the total count by category ? Each record could be updated once a product is added or dropped. The index.php page would only read this table.

 

Another solution could be to add a column to the "category" table storing the total products count.

 

What do you think ?

 

Didier.

Posted

Another solution would be to turn on configuration->cache to true. This would then cache the category display box and counts and not requiring any database changes.

 

HTH

Tom

Posted
Another solution would be to turn on configuration->cache to true. This would then cache the category display box and counts and not requiring any database changes.

 

But when I turn on the cache the category does not display...it only display the first time user landed on the site if they start clicking the category disappear and cannot get it back. I posted this but seem like I am the only one having this problem :-(.

 

Can you confirm if this is the case when you turn on the cache?

Posted

Good point with the cache. I had it on but not on my development machine. At least I can justify that with the cache on no more sql requests are done. THANKS TOM for the remark !

 

@Tranbo : nop..never had this problem. You should always see the categories but quicker with the cache on (you should also see the cache file for the category box).

 

Didier.

Posted

I had to turn my cache off since it was causing problems. I am on a shared server. My admin stopped working correctly and as soon as I turned it off, it worked.

 

My site wasn't live yet so I didn't have any orders so I can't say anything about getting customers with mixed up carts though.

 

The speed difference is negligable in my view, I can't tell.

 

Ryan

If I was crafty, this would be a funny signature.

Archived

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

×
×
  • Create New...