Re: "between" vs. ">= and <="

From: Robert Klemme <shortcutter_at_googlemail.com>
Date: Sat, 22 Nov 2008 11:58:38 +0100
Message-ID: <6oq6uvF4tqjeU2@mid.individual.net>


On 20.11.2008 07:10, Tim X wrote:

> This also confirms what I was taught. Essentially, BETWEEN is good
> because in many situations it makes the code more readable for
> developers and the intention clear, but from an execution perspective,
> the two give the same results.

Exactly. I would even go as far as to claim that there is no point in Oracle creating additional code for different handling of "between" vs. the operator version. They are semantically equivalent so why should they bother to create different execution plans other than because of a bug? Just translate "between" to the operator equivalent version and go from there - which exactly seems to be what 10g is doing.

> if the code is to be maintained in-house, maybe the client just wants
> the changes because they feel it will make things clearer to future
> maintainers?

No, the client has nothing to do with code maintenance. This was purely a performance optimization suggestion. As I said, I doubted the effect all the way but wanted to make sure I'm not missing anything. Sybrand claimed there once was an issue but unfortunately he did not mention a Oracle version where this might have been.

Kind regards

        robert Received on Sat Nov 22 2008 - 04:58:38 CST

Original text of this message