Good morning,
in our company we manage multiple client databases oracle .
Our framework "versions" records using 2 NUMBER(18) fields (lets call NSTART and NEND). So that we have, for example:
ExtId | NSTART | NEND |....and so on
+++++++++++++++++++++++++++++++++
1 | 1 | 10 |.....
1 | 10 | 12 |....and so on
1 | 12 | 999999999999999999 |....and so on
2 | 67 | 789 |....and so on
2 | 789 | 999999999999999999 |....and so on
The record with 999999999999999999 is the "last version record".
It happens that we have to identify the last version, so we look for the NEND = 999999999999999999.
In databases with million records, the "research" is really long and often seems to freeze...but we discovered that if we just change:
NEND = 999999999999999999
with
NEND > 999999999999999998
it is much more faster (doesnt freeze and takes just seconds, not minutes....)
Why?
Thanks
Alex