Possible to get LIMIT in an index access method?

From: Chris Cleveland <ccleveland(at)dieselpoint(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Possible to get LIMIT in an index access method?
Date: 2024-04-29 16:17:15
Message-ID: CABSN6VcacvmoVog6x3ueEk1X4iw_4SzHPiKe82JvsrEdwpH2Mg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I'm developing an index access method.

SELECT *
FROM foo
WHERE col <=> constant
ORDER BY col <==> constant
LIMIT 10;

I'm successfully getting the WHERE and the ORDER BY clauses in my
beginscan() method. Is there any way to get the LIMIT (or OFFSET, for that
matter)?

My access method is designed such that you have to fetch the entire result
set in one go. It's not streaming, like most access methods. As such, it
would be very helpful to know up front how many items I need to fetch from
the index.

--
Chris Cleveland
312-339-2677 mobile

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ranier Vilela 2024-04-29 17:10:44 re: Direct SSL connection and ALPN loose ends
Previous Message Tom Lane 2024-04-29 16:14:10 Re: Tarball builds in the new world order