Re: FWD/BACK/GOTO ? / ESQL
Posted in 1994
In article <758923278snz@edina.demon.co.uk> charlie@edina.demon.co.uk (Charlie Hussey) writes:
>From: charlie@edina.demon.co.uk (Charlie Hussey)
>Subject: Re: FWD/BACK/GOTO ? / ESQL
>Date: Tue, 18 Jan 1994 20:01:18 +0000
>In article <CJt1un.94p@unix.portal.com> pkellner@shell.portal.com writes:
>[stuff deleted]
>If the data is fairly static or updated in batch you could try
>the following (the syntax is not meant to be right):
>3 Backwards/Forwards is implemented as:
> select rowid, * into s_rowid, t.*
> from tab where @rowid = s_rowid - 1 (or + 1)>This of course only allows you to have one definition of forwards and
>backwards for a physical schema but should be pretty fast.
The biggest pitfall is that unless the data is absolutely static this approach
will not work. Rowids for deleted records are reused. Hence as soon as you
delete one record the index is no longer clustered. This no longer guarantees
you the ordering that you wish for. I could be mistaken about this but I seem
to recall some actual code to test it out!