Most DBAs and SQL experts resist
giving a straight or simple answer to a general question because there is no
simple and standard implementation that exists. Every situation is different,
and every organization is unique in some
way. So answering "it depends" to most questions can make a lot of sense. But "it depends" should never be the end of the answser!
Don’t be discouraged when you ask
the local expert which statement will perform better, and the answer is “It
depends.” The expert is just doing his or her job. The secret to optimizing DB2
performance is being able to answer the follow-up question to “It depends”—and
that is “What
does it depend on?”
The key
to effective SQL performance tuning is to document each SQL change along with
the reason for the change. Follow up by monitoring the effectiveness of every
change to your SQL statements before moving them into a production environment.
Over time, trends will emerge that will help to clarify which types of SQL
formulations perform best.
So the misunderstanding in this case is thinking that "it depends" is a complete answer to any type of question. It isn't... it is just the beginning of most answers. But it takes time, experience, and study to be able to answer what it depends upon. And that is why you might not get that answer unless you press for it... and attempt to find the answer yourself without just leaning on others for the answer all the time.
There is a corollary to the “It depends”
rule that also is important. Hard and fast rules that rigidly enforce or forbid
usage are not a good idea. In other words, this corollary is simply stated:
“Almost never say always or never.” Notice that even the wording of this
corollary embraces flexibility.
So be flexible, but embrace answers that help... because "it depends" helps nobody unless you tell them what it depends upon!