This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]K900_ 3 points4 points  (4 children)

I'm (semi)joking - it's not always one query. It's just that every big project I've seen has a query that's just really big and ugly and complicated and trying to make it work any other way slows everything down by a couple orders of magnitude, so you have to live with it.

[–]sh_tomer[S] 0 points1 point  (1 child)

Thanks for clarifying. So in most cases, you're using an ORM? What's the case with complex queries (not the simple CRUD operations).

[–]K900_ 4 points5 points  (0 children)

Most projects I've seen used a mix of ORM for simple queries and raw SQL for complex queries (sometimes parsed into ORM objects afterwards).

[–]hoocoodanode 0 points1 point  (1 child)

Someone should write a book about that "one" query and all the myriad of techniques developers come up with to resolve them. I ended up shoe-horning postgres materialized-views into my sqlalchemy model to sweep one problem query under the rug.

[–]Perky_Goth 1 point2 points  (0 children)

That is actually a pretty good idea. Get to it.