Idea : Re: status of Postgres "trasaction-free browsing" feature - Mailing list pgsql-hackers

From Jan Vicherek
Subject Idea : Re: status of Postgres "trasaction-free browsing" feature
Date
Msg-id Pine.LNX.3.96.980327024703.658D-100000@ann.ied.com
Whole thread Raw
List pgsql-hackers
On Thu, 26 Mar 1998, Bruce Momjian wrote:

> >    I vaguely remember that there was some consensus that this "detached"
> > or "non-transactional" browsing through a table by walking through an
> > existing index was a significant feature, very useful for people.
> >
> >     What is the status ?
>
> I don't think we found that it was very do-able in an SQL database, or
> we couldn't think of a good way to do it.

  Here goes an implementation idea :
 [ warning : I'm not duly familiar with pg sequences ]

   To instatiate an index "pointer" that would be used to go to next /
prev table item, one says "create sequence my_ind_seq on my_table_index".
Or maybe "declare sequence my_ind_seq on my_table_index" would be better.

   This will create a var as a temp variable for the duration of the
connection in the same way a cursor is declared. This variable will be of
special type "rowpointer" or something like that. One can then say
"next(my_ind_seq)" and it will change give value into pointer to next row.
Then one can say "select first rowpointer into my_ind_seq where ..." in
order to *jump* to a given table row. Also one could say ``last'' instead
of ``first''. That means that each table / temp table (result of select)
would have to have a hidden attribute called "rowpointer", similarly to
the hidden oid attribute.

 The effect would be that one could say "select * from mytable where
rowpointer = prev(my_ind_seq)", which would not only allow the
"detached"(no lock is kept for hours) browsing, but would also have the
effect of immediate retrieval of the row we are looking for, since the
rowpointer var contains the row pointer. (Row pointer is used in the
internals=guts of pgsql).


   How does that sound for an idea for an implememtation ? It may not be
perfect, but I hope it doesn't have basic conceptual flaws.

      TTYL,

         Jan


 -- Gospel of Jesus is the saving power of God for all who believe --
Jan Vicherek ## To some, nothing is impossible. ##  www.ied.com/~honza
    >>>    Free Software Union President  ...  www.fslu.org    <<<
Interactive Electronic Design Inc.    -#-    PGP: finger honza@ied.com


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Docs and psql \d commands
Next
From: Michael Meskes
Date:
Subject: Another parsing problem