Passing data out of indexam or tableam

From: Chris Cleveland <ccleveland(at)dieselpoint(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Passing data out of indexam or tableam
Date: 2021-08-02 16:41:51
Message-ID: CABSN6Vf4W9ntWwfHq2RuWHjOK1xPux5766_4mb4vR-zpu9AsfQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I'm attempting to develop a new type of full-text index. I've started
building a new index access method.

Is it possible to calculate values during the index scan and then make
them available for display in a select clause? For example,

SELECT title, score, total_hits
FROM mytable
WHERE (some search expression here)
ORDER BY score DESC
LIMIT 10

In this case, the index access method would calculate a score for each
row and attach it to the row for display. It would also calculate the
total number of hits, that is, rows that would be returned if there
were no LIMIT clause, and attach it only to the first row.

Is this possible?

Is it possible to do it with a table access method, as opposed to an
index access method?

--
Chris Cleveland
312-339-2677 mobile

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-08-02 16:57:36 Re: straightening out backend process startup
Previous Message Andres Freund 2021-08-02 16:41:24 straightening out backend process startup