public inbox for [email protected]
help / color / mirror / Atom feedFrom: Eric Ridge <[email protected]>
To: [email protected]
Subject: IndexAccessMethod API & Index Only Scans
Date: Fri, 27 Sep 2024 09:33:13 -0400
Message-ID: <[email protected]> (raw)
Hi all! Congrats on releasing v17!
I'm adding support for Index Only Scans to a custom IAM impl and I've got a little dilemma.
My IAM implementation is essentially a composite index that might have up to 32 columns and while it can return any column in the index definition it's quite expensive to do so. It doesn't have an already formed index tuple sitting right there like the built-in btree index does. Returning 1 or 2 columns is usually a win over the regular Index Scan version, but more than that and it's at least a wash if not a total loss.
Since not all Index Only Scans need *all* the columns, was there ever any thought around providing the required attnos as a field on IndexScanDescData? That information seems to be there in the nodeindexonlyscan.c machinery.
As a compromise, I've settled on my `amcanreturn` function saying it only knows how to return attno==1, which is sufficient for some query patterns, but I'd like to be able to have my index directly feed tuples into aggregate plans and such too. It's just too expensive for me to always return all the columns when generally maybe only 1 or 2 are needed (there doesn't seem to be a way to weave that into the cost estimations, but that wouldn't matter if I knew which specific columns I need to fetch out of my index).
I'm pretty familiar with the IAM and the internals around it, but maybe I've missed something -- can I get at this information some other way?
Thanks for your time and consideration!
eric
view thread (2+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: IndexAccessMethod API & Index Only Scans
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox