Data-Diggers.com | Zen Cart Optimization, Performance and A/B Split Testing Modules for Zen Cart

Archive for June 2009

Jun/09

29

Speed up admin/orders.php page

There’s suboptimal query in admin/orders.php page which retrieves information about last orders. Unfortunately query is constructed in such way that MySQL scans whole orders, orders_products and orders_total table. As always it’s not a problem until orders table gets big ( for example 50 000 entries ). If You happen to have at least 10 000 [...]

, , , ,

This is mainly note for me for future reference (ideas seem to pop out of my head quite quickly…). In future, I plan to make following modules:

to track user with cookie (even if he/she is not logged in). [Done, see:  User Tracking Interface]
to perform REPAIR TABLE on all tables from Admin panel
to split customers into groups randomly [...]

No tags

Store Credit is great module, unfortunately it’s preety inefecient in some places. For example, on every page request of admin/store_credit.php whole customers table is read, and for each customer additional SELECT and UPDATE query is executed to calculate and update pending points, even if the customer does not have any pending points!
It’s not a big deal [...]

, ,

Version v1.5.1 of Query Log is available. You can download it from: www.data-diggers.com/contribs/query-log/downloads/querylog-current.zip .
What’s new in this version:

You can now close ‘calculator’ layer (it’s the tool that highlights queries that match given regular expression)
You can now disable query logging completely. In previous versions Query Log kept all queries in memory, no matter if You wanted to [...]

, ,

I noticed that following query takes long time to execute:

SELECT DISTINCT op.products_id
FROM orders o, orders_products op, products p
WHERE o.customers_id = ‘2345′
AND o.orders_id = op.orders_id
AND op.products_id = p.products_id
AND p.products_status = ‘1′
GROUP BY products_id
ORDER BY o.date_purchased DESC
LIMIT 6

I noticed that there’s no index on orders table on customers_id field. Without it MySQL has to scan whole table [...]

, , , ,

Find it!

Theme Design by devolux.org