Re:"I've isolated the bug to a database query"
by kfool on Thursday November 10, 2011 @09:51PM
(#3223141)
Not always. An app requiring non-trivial SQL can be an indication of a problem requiring non-trivial workflows.
If the problem is complex, you want to model relations, not ignore them.
(But clearly not in this hairy query.)
There is a point between transactional and data warehousing that needs to be hit. Simple summaries or considering the question of "how do I retrieve everything in this state" will sometimes suffice. Building a system to get single transactions in an out tends to make routine report take all night or be impossible to get in a reasonable amount of time.
If your schema and app requires non-trivial SQL, then expect maintenance nightmares and lack of ability to scale.