in reply to Re^2: Counting events and getting top 5 matches
in thread Counting events and getting top 5 matches
I'm a strong supporter of the view that when you can have the DBMS do the work, you must.
I'm not so sure that's always the case. There can be a real tradeoff between performance and maintainability there. I've seen some of the hairy twenty-page stored procedures people write when they're trying to do something in SQL that is fundamentally better suited to a general-purpose high-level language and would be less than a screenful of clean, easy-to-read Perl.
Certainly, there are times when it's better to have the DBMS do the work...