Re: Get the offset of a tuple inside a table - Mailing list pgsql-hackers

From Pei He
Subject Re: Get the offset of a tuple inside a table
Date
Msg-id AANLkTinFS1DMFcGBNubD+WcHUDZBepRaFv_==t5oeCFP@mail.gmail.com
Whole thread Raw
In response to Re: Get the offset of a tuple inside a table  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List pgsql-hackers
I doesn't realized postgresql can be such clever.

Another problem I just found is after one tuple is deleted, there will be some slots unoccupied. The offset cannot be computed even know how much tuples a page can contain.

I need one hash table.

Thanks
--
Pei

On Tue, Sep 21, 2010 at 8:47 PM, Kevin Grittner <Kevin.Grittner@wicourts.gov> wrote:
Pei He  wrote:

> The offset is the order of a tuple in a Sequential Scan.

That's not a safe assumption.  Try starting a sequential scan against
a large table on one connection; then before it finishes, start the
same query on another connection.  The second query joins the one
already in progress and then starts over, "wrapping around".

-Kevin

pgsql-hackers by date:

Previous
From: Itagaki Takahiro
Date:
Subject: Re: trailing whitespace in psql table output
Next
From: Tom Lane
Date:
Subject: Multi-branch committing in git, revisited