MySQL Performance Blog - Mon, 17/09/2007 - 4:35pm
Quite typical query for reporting applications is to find top X values. If you analyze Web Site logs you would look at most popular web pages or search engine keywords which bring you most of the traffic. If you're looking at ecommerce reporting you may be interested in best selling product or top sales people. This information may often need simple select query, however what if you would like to show percents not just absolute value ?
For illustration purposes I've created a syntetic table filled with some 30mil rows evenly spread in 10.000 groups.