Passing data out of indexam or tableam - Mailing list pgsql-hackers

From Chris Cleveland
Subject Passing data out of indexam or tableam
Date
Msg-id CABSN6Vf4W9ntWwfHq2RuWHjOK1xPux5766_4mb4vR-zpu9AsfQ@mail.gmail.com
Whole thread Raw
List 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



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: straightening out backend process startup
Next
From: Tom Lane
Date:
Subject: Re: straightening out backend process startup