Re: [HACKERS] Show stopper ? (was: Re: "cruising" or "browsing" through tables using an index / ordering)

From: Jan Vicherek <honza(at)ied(dot)com>
To: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
Cc: scrappy(at)hub(dot)org, dustin(at)spy(dot)net, pgsql-questions(at)postgreSQL(dot)org, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Show stopper ? (was: Re: "cruising" or "browsing" through tables using an index / ordering)
Date: 1998-01-24 04:20:09
Message-ID: Pine.LNX.3.96.980123230503.497J-100000@ann.ied.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hey ! You sound like you know exactly what I mean ! ;-)

On Fri, 23 Jan 1998, Bruce Momjian wrote:

> > Important : I'm not looking for a "pure SQL" solution. I'm writing a C
> > emulation library, so if it can be achieved via a call to a C Postgres
> > function, it would be great.
>
> You can put an index on the table, and embed a function inside the
> engine to spin through the index, getting valid rows.

Aha, this implies that in the index there are valid and non-valid rows.
I guess those that are to be "valid" (no current transactions on that
row) and the non-valid "those that are subject to an update lock /
transaction".

> The code is
> already there to spin through the index, so you could just hook on to
> the index, get the 'tid' and use that to get data from the physical
> table.

This sounds like what I meant. Would you have any pointers (to source
files / functions I should read / understand / call ) ?

> No locking, but you may get in trouble if other people are
> reading the index.

I don't see what trouble I could get into. Any hints appreciated.

> Maybe a quick lock-unlock would do it for you.

Do you mean lock-unlock on the table or on the index ?

> Not easy, because the engine really doesn't provide a user-friendly C
> interface for this, but it could be done.

Can you point me to some of the user-nonfriendly files / functions I
should use then ?

Thanx a bunch (I have to have the implementation by tomorrow 10am),

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(at)ied(dot)com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Vicherek 1998-01-24 04:24:00 Re: [QUESTIONS] Attn PG gurus / coders : New approach for ORDER BY ? (was: Re: Show stopper ?)
Previous Message Ron O'Hara 1998-01-24 04:18:05 Re: [QUESTIONS] Attn PG gurus / coders : New approach for ORDER BY ? (was: Re: Show stopper ?)