Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s1Th8-00CaE3-Ko for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Apr 2024 16:17:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1s1Th6-000RH8-3J for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Apr 2024 16:17:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s1Th5-000RGr-KX for pgsql-hackers@lists.postgresql.org; Mon, 29 Apr 2024 16:17:32 +0000 Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s1Th3-000hTi-GH for pgsql-hackers@postgresql.org; Mon, 29 Apr 2024 16:17:31 +0000 Received: by mail-oi1-x233.google.com with SMTP id 5614622812f47-3c750fd1202so2748040b6e.2 for ; Mon, 29 Apr 2024 09:17:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dieselpoint-com.20230601.gappssmtp.com; s=20230601; t=1714407447; x=1715012247; darn=postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=gPGz9CfWCWoCd50XUzTbn/km2xyLRfL4Ee9wSqULDd0=; b=OFo+W9wJ9MNzsFEoue8xytKpTngXc758tGfLDsD4w+jzfjIqwUOBxvps9VXuZ6Yojm T8X/f/CNBGFbGM1FsuzotGsM1bJtkPq/pDHg5ZlUxFEXuUrXHmb47brhtLnYt1eTdb5Z Rhrl+vQj+g/4SQUA17giyAZkU3OJiyBmiqFi41QNDElFD5JVx7dyn/ME03hk7/R8cMOD hJcJBQwIcFtuqTRyqzWDYJKcNv5w/r+y6sK4Dm+ATdCuU+brcoZ7xUpyzIoaCV3v5Hv6 8y+QKFYNhNBEwYocAM3Yw1EawqKtCAl71Qy1GgisGmgkisfI5n7OwbORCAHjUsibPPM7 AXww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714407447; x=1715012247; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=gPGz9CfWCWoCd50XUzTbn/km2xyLRfL4Ee9wSqULDd0=; b=VBq8g4Pliu5WW/OaGSz0305nEVvRyrUJxvCGaAc9cMOdKNMF/3e6bvzv2Iwrq9GcdF z2QMLtTdTtoYPJv2FPl5z5/3WK8FIFIA0dkDdaMdb/JBHLi5yIn1gCl8wlmL2y6qPS6P PZs2Rpp8meBtPEQwBw15a2/WST5d4pPN95YME2YGTJYA1HqNl9BsKSLRaHrsWCy8/4Uf nAJMLvTyNowWjVHwfhTK+R/hr/5lSnVuFR2bfrab+ow/TsGea9ND/OjgoYKVxAFRW+YI LFbIkpOMFlvC+xGp4Lkl2AalpA9DabHpwkKmafP7f9FoVsIqW6Xuod6E5sVmP+hX1cNd 1vHQ== X-Gm-Message-State: AOJu0YyjQZGeyC5uyQhvIOweN+u64fjd0n4tLklHGS+2jQ5OvQPnZ7Jl 8B73S+htdzP5IPcz40x/AydCxjnKc1GLFw+bxGnhheZc5QFhNyDUJEnxQbW0UzXGrDYOwPaFrSI z7DP118665dgsBBkPFfEFdukdWD81fBGTZjMWMSa12GjEwneP X-Google-Smtp-Source: AGHT+IE80lYx1I4YNLoGUOYYw4z1MI4UzhSNkfgWPzX8ubZDk+9gg3qQVn7k/6uM3HMxuRQ1QSuaWo9dVwvPUhKGT5c= X-Received: by 2002:a54:458c:0:b0:3c8:2eda:bcb9 with SMTP id z12-20020a54458c000000b003c82edabcb9mr11306091oib.7.1714407447171; Mon, 29 Apr 2024 09:17:27 -0700 (PDT) MIME-Version: 1.0 From: Chris Cleveland Date: Mon, 29 Apr 2024 11:17:15 -0500 Message-ID: Subject: Possible to get LIMIT in an index access method? To: PostgreSQL Hackers Content-Type: multipart/alternative; boundary="000000000000e3c42806173e96d8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000e3c42806173e96d8 Content-Type: text/plain; charset="UTF-8" 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 --000000000000e3c42806173e96d8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I'm developing an index access method.
=
SELECT *
FROM foo
WHERE col <=3D> = constant
ORDER BY col <=3D=3D> constant
LIMIT 10;=

I'm successfully getting the WHERE and the OR= DER 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= 9;s not streaming, like most access methods. As such, it would be very help= ful to know up front how many items I need to fetch from the index.

--
Chris Cleveland<= div>312-339-2677 mobile
--000000000000e3c42806173e96d8--