Morning all,
As you probably all know I'm doing a presentation on Query Tuning at the EMEA PUG. One section I want to do is about common bad queries and how to avoid them/fix them. I've got a whole gamut of nausea-inducing examples but I'm sure I'm missing some. So if you have five minutes to share your queries from hell then please do. It will help me make an even more useful session for folks.
Thanks
Some examples of what I'm covering:
As you probably all know I'm doing a presentation on Query Tuning at the EMEA PUG. One section I want to do is about common bad queries and how to avoid them/fix them. I've got a whole gamut of nausea-inducing examples but I'm sure I'm missing some. So if you have five minutes to share your queries from hell then please do. It will help me make an even more useful session for folks.
Thanks
Some examples of what I'm covering:
- Functions on the left of the query predicate
- Functions on the right of the query predicate
- Lots of OR statements
- Things like WHERE Order.OrderNum EQ (IF lvOrderNum NE 0 THEN lvOrderNum ELSE Order.OrderNum)
- Queries where the tables are in the wrong order, so Each order, each orderline, each item where item... turn that round to reference item first.