Re: Tid scan improvements
Edmund Horner <ejrh00@gmail.com>
From: Edmund Horner <ejrh00@gmail.com>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Tomas Vondra <tomas.vondra@2ndquadrant.com>, PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2019-03-15T05:42:40Z
Lists: pgsql-hackers
Attachments
- v7-0001-Add-selectivity-estimate-for-CTID-system-variables.patch (application/octet-stream) patch v7-0001
- v7-0002-Support-backward-scans-over-restricted-ranges-in-hea.patch (application/octet-stream) patch v7-0002
- v7-0004-TID-selectivity-reduce-the-density-of-the-last-page-.patch (application/octet-stream) patch v7-0004
- v7-0003-Support-range-quals-in-Tid-Scan.patch (application/octet-stream) patch v7-0003
On Thu, 14 Mar 2019 at 23:37, Edmund Horner <ejrh00@gmail.com> wrote: > On Thu, 14 Mar 2019 at 23:06, David Rowley <david.rowley@2ndquadrant.com> wrote: > > Just looking again, I think the block of code starting: > > > > + if (density > 0.0) > > > > needs a comment to mention what it's doing. Perhaps: > > > > + /* > > + * Using the average tuples per page, calculate how far into > > + * the page the itemptr is likely to be and adjust block > > + * accordingly. > > + */ > > + if (density > 0.0) > > > > Or some better choice of words. With that done, I think 0001 is good to go. > > Ok, I'll look at it and hopefully get a new patch up soon. Hullo, Here's a new set of patches. It includes new versions of the other patches, which needed to be rebased because of the introduction of the "tableam" API by c2fe139c20. I've had to adapt it to use the table scan API. I've got it compiling and passing tests, but I'm uneasy about some things that still use the heapam API. 1. I call heap_setscanlimits as I'm not sure there is a tableam equivalent. 2. I'm not sure whether non-heap tableam implementations can also be supported by my TID Range Scan: we need to be able to set the scan limits. There may not be any other implementations yet, but when there are, how do we stop the planner using a TID Range Scan for non-heap relations? 3. When fetching tuples, I see that nodeSeqscan.c uses table_scan_getnextslot, which saves dealing with HeapTuples. But nodeTidrangescan wants to do some checking of the block and offset before returning the slot. So I have it using heap_getnext and ExecStoreBufferHeapTuple. Apart from being heapam-specific, it's just not as clean as the new API calls. Ideally, we can get to to support general tableam implementations rather than using heapam-specific calls. Any advice on how to do this? Thanks Edmund
Commits
-
Add TID Range Scans to support efficient scanning ranges of TIDs
- bb437f995d47 14.0 landed
-
Improve planner's selectivity estimates for inequalities on CTID.
- f7111f72d2fd 12.0 landed