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.

6
  • Thanks for the very thorough answer. You've got me thinking now. My big concern here is that everything I read says don't SELECT *, rather only select the fields you require. For example, see this question. As for all those ad-hock queries you speak of, I certainly understand where you're coming from. I have a very large app right now that has many of them. That was my "Well it had to give somewhere!" moment, I opted for maximum performance. However, now I'm dealing with LOTS of different queries. Commented Apr 23, 2013 at 22:50
  • 1
    One follow up thought. I've seen a recommendation to use a R—CUD approach. Since reads are often where performance issues arise, you could use a more custom query approach for them, that don't translate into real business objects. Then, for create, update and delete, use an ORM, which works with whole objects. Any thoughts on that approach? Commented Apr 23, 2013 at 22:54
  • 1
    As a note for using "select *". I've done it in the past and it worked ok - until we hit varchar(max) fields. Those killed our queries. So if you have tables with ints, small text fields, etc. it's not that bad. Feels unnatural, but software goes that way. What was bad is suddenly good and vice versa. Commented Apr 23, 2013 at 23:03
  • 3
    The R-CUD approach is actually CQRS Commented Apr 29, 2013 at 11:39
  • 2
    @ryan1234 "The complexity at the end of the day has to exist somewhere." Thank you for this. Makes me feel better. Commented Aug 25, 2014 at 19:04