News for hackers. Stuff that matters.
Re:How Not To Sort By Average Rating by alexandros on Thursday February 12, 2009 @04:10PM (#478992)
This is a dream of mine as well, but performance may be a problem. Custom functions mean no caching and arbitrary computational burden from each function.
Re:How Not To Sort By Average Rating by ars on Thursday February 12, 2009 @07:06PM (#479208)
It doesn't have to be totally custom. Just solicit a few representative types and allow all those. This also solves the problem of not everyone knowing how to write such a function, and dealing with user code running on the server.
Re:How Not To Sort By Average Rating by IsaacSchlueter on Thursday February 12, 2009 @11:51PM (#479455)
Better yet, play around with lots of different sorting methods, and look for patterns in the sorting method used (s), the user's data and history (h), and the amount of money the user ends up spending ($).

Maximize $, and don't ask stupid questions like "Would you rather sort by variance, average rating, or Wilson score?"

(I'm pretty sure that's what Amazon is busy doing every day. They're positively brilliant at turning data into money.)

Re:How Not To Sort By Average Rating by trezor on Friday February 13, 2009 @08:52AM (#479833)
Custom functions mean no caching

This only applies if you are using a sub-par database. While caching computationally heavy operations is not always a good choice (since they will need to get updated when more entries are added to the dataset), chances are you will have orders of magnitudes more lookups than writes and hence it makes sense to create a computed column and index the results (and hence cache them).