Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pOPP1-0004Ky-6j for pgsql-hackers@arkaria.postgresql.org; Sat, 04 Feb 2023 20:44:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pOPOz-0001oy-Q2 for pgsql-hackers@arkaria.postgresql.org; Sat, 04 Feb 2023 20:44:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pOPOz-0001op-En for pgsql-hackers@lists.postgresql.org; Sat, 04 Feb 2023 20:44:49 +0000 Received: from mail-yb1-xb30.google.com ([2607:f8b0:4864:20::b30]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pOPOp-00046A-84 for pgsql-hackers@lists.postgresql.org; Sat, 04 Feb 2023 20:44:49 +0000 Received: by mail-yb1-xb30.google.com with SMTP id d132so10200824ybb.5 for ; Sat, 04 Feb 2023 12:44:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=091/c3mlrm+VCGrTIl7EldNB30Ny3VdlfhwPhGBgzCc=; b=I+VH3RsoKuWfzwlzg53oG+vAJWfBLIPaA3753kHW85DivQMFfseX6OtEKcK8+517Uu GTuATqWaZTLYrp36maioRmwkXCmVMLc5WEsjvOM3e7tklYKxyokgQVVx0Op+GfYcc+Ja X7nAXA8XGNEiEwu9TWNBgDE7EpwOGxbQyP/EIBll8sbPUQrqmB+SWUA4iLy7Lqc1HRc4 xKFQ+TArCsNqj/IfxruoA1dDeR/iC4vfFyANrKqoZ/tDijnJItZfn/CUYAF41PqNED4a F9X8gOM005ztLZylhyCpGTFeobgYf5RLa9Th3KRHHi10mN7E0Cj0tkJ3gGmXAEAIg93e cYGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=091/c3mlrm+VCGrTIl7EldNB30Ny3VdlfhwPhGBgzCc=; b=P/pb1KCv1H/6SVpa1LEX2MN420Dow8gIadmRAXmEteEldo78L/k51x7Ze7LtNN0We5 1HOw9eE7M8J0zyLG+R8SMJgqnHeuD7Wp4GC2S9JeUtELpgva4xK6atzKJ8M89+ajG57s tNWshVZS2gw94zmunrNUAcWu2X40Hx/TWvpMX9WZf28vbJMgQAq4Ao+hnY2XXwJH17GS P4CkaE5Bkxkx5EDqaInJEw0Ke6YCVryMtyz06JL4Yp/0YV3dZZ4bQ/arRS/7UxiOwL98 zJ2Znnodha1cZUGFI51e5h5s9IPNsaj5dOkNrI516unwDd/FUKtEfbW+wT8sAAA02XZX DO0g== X-Gm-Message-State: AO0yUKUnpYxauvNn80m4FHFxqk9df28YBUsA+5X/2BMJ7xF6FsQiBzrj sEbRUcHBbR1GISZX4SNGQzJsjweS9twu30zl61I= X-Google-Smtp-Source: AK7set+C9MEQR4UqLFFFo/4zCxvmGHl/BiJofppzxSJaCI8dj1WB7a96Io9CGJusPKJZB5X/KqYfUTles36Gwe+YH/I= X-Received: by 2002:a25:2d15:0:b0:807:4bf9:f810 with SMTP id t21-20020a252d15000000b008074bf9f810mr1633134ybt.409.1675543477714; Sat, 04 Feb 2023 12:44:37 -0800 (PST) MIME-Version: 1.0 References: <2023020416592307671913@gmail.com> In-Reply-To: <2023020416592307671913@gmail.com> From: Andrey Borodin Date: Sat, 4 Feb 2023 12:44:26 -0800 Message-ID: Subject: Re: How to implement read operations for my own access method? To: "jacktby@gmail.com" Cc: pgsql-hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, Feb 4, 2023 at 12:59 AM jacktby@gmail.com wrote: > > > Hi,I'm trying to implement my own access method. But I find the functions baout read is difficult. > Can you give me an existed easy extension that impelment the tableamroutine to reference? I ho[e > it's not complicated like heap_am,and it support insert sqls and select sqls.Thanks > Hi Jack, I'd recommend first to start from official documentation on index access methods [0]. Please also check the contrib/bloom module [1]. It is designed to showcase index-as-extension technology. Also, you can see my free lectures about details of implementation of built-in access methods [2]. Also, I can offer you my PGCon talk "Index DIY" about forking GiST into extension [3]. Thank you! Best regards, Andrey Borodin. [0] https://www.postgresql.org/docs/current/xindex.html [1] https://github.com/postgres/postgres/tree/REL_15_STABLE/contrib/bloom [2] https://www.youtube.com/watch?v=UgSeSo973lA&list=PLzrhBdcKTjLTyCIdDO1ig8qCZFZYYi3VH [3] https://github.com/x4m/index_diy