Thread: Passing data out of indexam or tableam

Passing data out of indexam or tableam

From
Chris Cleveland
Date:
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