Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 10
    3 - 4 joins is by no means a large SQL Statement. Let the RDBMS choose the join strategy and do the filtering. See Joins are for lazy people? Commented Aug 29, 2011 at 17:36
  • 1
    General good practice: try to use the minimum number of SQL queries in your application. Less queries is always a good thing. If I were in your case, I would stick with the joins.Better performance, less time communicating with the database. Commented Aug 29, 2011 at 17:37
  • Depending who looks at which pieces of code, you may be able to improve client-side readability by defining views for long SELECT queries. Commented Aug 29, 2011 at 18:15
  • Actually, I just threw 3 - 4 out there. Purely hypothetical. Just thinking if we should refactor queries into small steps, just like we should/do with methods. Commented Aug 30, 2011 at 12:29