2 ms·
Kind of an issue for optimizers in any situation. You're relying on implicit behavior which may change. Unless you decide to document it and guarantee the opti
by adrianmonk 7y ago
Kind of an issue for optimizers in any situation. You're relying on implicit behavior which may change.
Unless you decide to document it and guarantee the optimization will be applied if certain conditions are met. Though that has its own downsides because now the system is locked into providing that guarantee. (Real-world example of a guarantee: in C, the "&&" and "||" operators are guaranteed to be lazy. Writing "0 && (1/0)" should be safe; you won't divide by zero because the spec guarantees it's optimized away.)
Or I guess you could try other approaches like having the database detect that it could be optimized, but then tell you to rewrite your own code instead of rewriting it for you.