[vox-tech] MySQL question: making stats out of orders

Bill Broadley bill at broadley.org
Tue Dec 1 22:58:30 PST 2009


Hrm, trying to figure out a non-proprietary question ask, that would be useful.

Ah, how about what is the ratio between:
 (unique orderitem.productid today)
 ----------------------------------
     orders today

Assuming it's high you could make it much easier to deal with by building a
table of:
<date>,<orderitem.productid>,<qty>

Then finding the most popular in the last 90 days, or today, or the "hot" item
that raised in the rankings the most today becomes easy.

I used this approach for handling a few 100k web hits/day and it allowed for
much more complex queries and still got my answers very quickly.  We logged
directly to Mysql and wanted to handle lots of complex queries of years of
logs.  We typically got our answers in a few seconds or less.


More information about the vox-tech mailing list