Re: Tid scan improvements - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Tid scan improvements
Date
Msg-id 10208.1545347201@sss.pgh.pa.us
Whole thread Raw
In response to Re: Tid scan improvements  (Andres Freund <andres@anarazel.de>)
Responses Re: Tid scan improvements
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2018-12-20 17:21:07 -0500, Tom Lane wrote:
>> I'm having a hard time wrapping my mind around why you'd bother with
>> backwards TID scans.

> I've not followed this thread, but wouldn't that be quite useful to be
> able to move old tuples to free space earlier in the table?
> I've written multiple scripts that update the later pages in a table, to
> force reuse of earlier free pages (in my case by generating ctid = ANY()
> style queries with all possible tids for the last few pages, the most
> efficient way I could think of).

Sure, but wouldn't you now write those using something on the order of

      WHERE ctid >= '(cutoff_page_here, 1)'

?  I don't see that you'd want to write "ORDER BY ctid DESC LIMIT n"
because you wouldn't know what value of n to use to get all the
tuples on some-number-of-ending-pages.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Why are we PageInit'ing buffers in RelationAddExtraBlocks()?
Next
From: Andres Freund
Date:
Subject: Re: Tid scan improvements