Re: Tid scan improvements - Mailing list pgsql-hackers

From David Rowley
Subject Re: Tid scan improvements
Date
Msg-id CAKJS1f8FyS51b6j++qShP_av5Kq1oq83t16ALPftPm4F0BbqkQ@mail.gmail.com
Whole thread Raw
In response to Re: Tid scan improvements  (Edmund Horner <ejrh00@gmail.com>)
Responses Re: Tid scan improvements
List pgsql-hackers
On 15 August 2018 at 11:11, Edmund Horner <ejrh00@gmail.com> wrote:
So we'd extend that to:
  - Include in the OR-list "range" subquals of the form (ctid > ? AND
ctid < ?) (either side could be optional, and we have to deal with >=
and <= and having ctid on the rhs, etc.).
  - Cost the range subquals by assuming they don't overlap, and
estimating how many blocks and tuples they span.
  - When beginning the scan, evaluate all the ?s and build an array of
"tid ranges" to fetch.  A tid range is a struct with a starting tid,
and an ending tid, and might just be a single tid item.
  - Sort and remove duplicates.
  - Iterate over the array, using a single fetch for single-item tid
ranges, and starting/ending a heap scan for multi-item tid ranges.

I think I'll try implementing this.

I've set this patch as waiting on author in the commitfest app. 


--
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

pgsql-hackers by date:

Previous
From: Rajkumar Raghuwanshi
Date:
Subject: Multiple primary key on partition table?
Next
From: Michael Paquier
Date:
Subject: Re: pgsql: Improve autovacuum logging for aggressive andanti-wraparound ru