Thursday, March 31, 2005, 5:53:12 PM, you wrote:
>> The actual test I'm doing is something like:
>> WHERE ?1 >= (base + begin) AND ?1 < (base + end)
>> where ?1, base, begin, and end are all 64-bit addresses.
> This is a test with a well known optimization for unsigned values:
> WHERE (?1 - base - begin) < end
> To make the < test unsigned in SQL use
> WHERE ((?1 - base - begin) + 9223372036854775808)) < (end +
> 9223372036854775808)
> This is with all values stored "raw," i.e., without offset.
Oops, I meant
WHERE (?1 - base - begin) < (end - begin)
To make the < test unsigned in SQL use
WHERE ((?1 - base - begin) + 9223372036854775808)) < ((end - begin) +
9223372036854775808)
This works as long as end > begin.
e