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.96) (envelope-from ) id 1wKAZe-000gNz-1e for pgsql-announce@arkaria.postgresql.org; Tue, 05 May 2026 07:52:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wKAZd-00Aly9-1S for pgsql-announce@arkaria.postgresql.org; Tue, 05 May 2026 07:52:09 +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.96) (envelope-from ) id 1wKAZc-00Alxw-2B for pgsql-announce@lists.postgresql.org; Tue, 05 May 2026 07:52:08 +0000 Received: from mahout.postgresql.org ([2001:4800:3e1:1::227]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wKAZZ-00000000bAT-2TRm for pgsql-announce@lists.postgresql.org; Tue, 05 May 2026 07:52:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Message-ID:Date:Reply-To:From:To:Subject: MIME-Version:Content-Type:Sender:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:In-Reply-To:References; bh=giKbK0eSkJfWQivTRDFjCAOmmD8J5CPYzncM6nF20nY=; b=CRbnpaCYIMFBRhr7/FHM5/gl9a 45/H9E7xdpEdNi/1Agzix597FsXaJfaYyLn7Hw1Yu0/e3K2wTQBAtq6WlP+OVJ0cZltasCdfhdc7m GzaX/5v0nULVKke9IS5TH5A4kQvMIhLcPsnPyiT8yjPCMVp4dAA5whQ9czyw0V6UW8SAjxggIIqmC 30tL0RttpjpUnOWr5vEJz2h4k3pibJJlojbk5Qj1QaXsmc+1sHC7+EVSgBjqXyQi/W1+j93QKyAz2 HOgoydcwE28FY0GjwV1pBacuipj525H2izpSuHcctJoTmHeR1AvX8Kke74Z/vhQ/kHG/Y4/QB16hk 0RdBJ8iA==; Received: from wrigleys.postgresql.org ([2a02:16a8:dc51::60]) by mahout.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wKAZX-000nf0-1B for pgsql-announce@lists.postgresql.org; Tue, 05 May 2026 07:52:04 +0000 Received: from localhost ([127.0.0.1] helo=wrigleys.postgresql.org) by wrigleys.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wKAZW-003UB8-1S for pgsql-announce@lists.postgresql.org; Tue, 05 May 2026 07:52:02 +0000 Content-Type: multipart/alternative; boundary="===============3710267551810128770==" MIME-Version: 1.0 Subject: pg_sorted_heap 0.13.0 released To: PostgreSQL Announce From: "Sergey \"Computer Mage\" Kuznetsov via PostgreSQL Announce" Reply-To: github@iterudit.com Date: Tue, 05 May 2026 07:51:31 +0000 Message-ID: <177796749115.792.14983005245383092630@wrigleys.postgresql.org> X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-pglister-tags: related X-pglister-tagsig: a7d90948c7069230a970ac1b75bd9537947432bc19cddb4facc6a808c266a432 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --===============3710267551810128770== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable I am pleased to announce `pg_sorted_heap 0.13.0`, a PostgreSQL extension for physically sorted heap storage, zone-map pruning, planner-integrated vector search, and a narrow fact-shaped GraphRAG query surface. Repository: https://github.com/skuznetsov/pg_sorted_heap Release: https://github.com/skuznetsov/pg_sorted_heap/releases/tag/v0.13.0 ## What is pg_sorted_heap? `pg_sorted_heap` is a PostgreSQL extension that adds: - `sorted_heap`: a table access method that keeps rows physically ordered by primary key and prunes heap blocks with per-page zone maps. - `sorted_hnsw`: a planner-integrated HNSW index access method for built-in vector types. - `svec` and `hsvec`: float32 and float16 vector types for PostgreSQL. - Fact-shaped GraphRAG helpers for retrieving and reranking graph-shaped fa= cts directly inside PostgreSQL. The storage side is aimed at workloads where physical locality matters: time-series data, event logs, IoT readings, ordered IDs, and large tables w= ith range predicates on primary-key columns. The vector and GraphRAG side is aimed at applications that want retrieval to stay inside PostgreSQL instead of introducing a separate vector-search side= car. ## What is new in 0.13.0? The main change in `0.13.0` is that the narrow fact-shaped GraphRAG contrac= t is now part of the stable release surface. The stable GraphRAG API includes: - `sorted_heap_graph_rag(...)` - `sorted_heap_graph_register(...)` - `sorted_heap_graph_config(...)` - `sorted_heap_graph_unregister(...)` - `sorted_heap_graph_rag_stats()` - `sorted_heap_graph_rag_reset_stats()` This contract is intentionally narrow. It is designed for fact tables clust= ered by `(entity_id, relation_id, target_id)`, or by an equivalent registered al= ias mapping. Queries start with ANN seed retrieval, expand through one or more relation hops, and then exact-rerank the expanded candidate set. Example: SELECT * FROM sorted_heap_graph_rag( 'facts'::regclass, '[0.1,0.2,0.3,...]'::svec, relation_path :=3D ARRAY[1, 2], ann_k :=3D 64, top_k :=3D 10, score_mode :=3D 'path' ); `0.13.0` also adds a stable routed GraphRAG entry point for multi-shard or multi-tenant application flows: - `sorted_heap_graph_route(...)` - `sorted_heap_graph_route_plan(...)` This gives applications one dispatcher for exact-key routing, range routing, profiles, policies, and defaults. ## Other release highlights `0.13.0` also includes: - Schema registration for non-canonical fact tables, so GraphRAG can be used with existing column names. - Backend-local GraphRAG stage stats: seed count, expanded rows, reranked r= ows, returned rows, and per-stage timing. - Lifecycle hardening across extension upgrade, dump/restore, crash recover= y, concurrent online compact, and concurrent online merge. - A shared-cache correctness fix for `sorted_hnsw` multi-index workloads. - `sorted_hnsw.build_sq8`, an opt-in low-memory index-build mode for constrained builders. - An experimental FlashHadamard retrieval lane. This is documented and test= ed, but it is not the default ANN path and not part of the stable GraphRAG contract. ## Benchmark snapshots These are workload-specific benchmark snapshots from the release notes, not universal performance claims. AWS Gutenberg workload, about `104K x 2880D`, top-10: - `sorted_hnsw (svec)`: `1.287 ms`, `100.0% Recall@10` - `sorted_hnsw (hsvec)`: `1.404 ms`, `100.0% Recall@10` - pgvector `halfvec`: `2.031 ms`, `99.8% Recall@10` AWS fact-shaped multihop GraphRAG workload, `5K` chains, `384D`: - `sorted_heap_expand_twohop_path_rerank()`: median `0.962 ms` - `sorted_heap_graph_rag_twohop_path_scan()`: median `1.025 ms` - pgvector parity row: median `1.434 ms` - Qdrant parity row: median `3.355 ms` ## Installation Requirements: - PostgreSQL 17 or 18 - Standard PGXS build toolchain with `pg_config` in `PATH` Build from source: git clone https://github.com/skuznetsov/pg_sorted_heap.git cd pg_sorted_heap make make install Enable the extension: CREATE EXTENSION pg_sorted_heap; Upgrade an existing installation: ALTER EXTENSION pg_sorted_heap UPDATE TO '0.13.0'; ## Minimal examples Create a physically sorted table: CREATE TABLE events ( id bigint PRIMARY KEY, ts timestamptz, payload text ) USING sorted_heap; SELECT sorted_heap_compact('events'::regclass); Create a planner-integrated HNSW index: CREATE TABLE documents ( id bigserial PRIMARY KEY, embedding svec(384), content text ); CREATE INDEX documents_embedding_idx ON documents USING sorted_hnsw (embedding) WITH (m =3D 16, ef_construction =3D 200); SET sorted_hnsw.ef_search =3D 96; SELECT id, content FROM documents ORDER BY embedding <=3D> '[0.1,0.2,0.3,...]'::svec LIMIT 10; Create a stable fact-shaped GraphRAG table: CREATE TABLE facts ( entity_id int4, relation_id int2, target_id int4, embedding svec(384), payload text, PRIMARY KEY (entity_id, relation_id, target_id) ) USING sorted_heap; CREATE INDEX facts_embedding_idx ON facts USING sorted_hnsw (embedding) WITH (m =3D 24, ef_construction =3D 200); ## Verification The `0.13.0` release-candidate checks include: - SQL regression coverage for `pg_sorted_heap`, `sorted_hnsw`, and `graph_r= ag` - GraphRAG lifecycle coverage for upgrade and dump/restore - crash recovery checks - concurrent online-operation checks - `pg_upgrade` coverage from PostgreSQL 17 to 18 - `sorted_hnsw` chunked/shared-cache integration checks For local verification: make test-release For the narrower GraphRAG release bundle: make test-graphrag-release ## Links - Repository: https://github.com/skuznetsov/pg_sorted_heap - Documentation: https://skuznetsov.github.io/pg_sorted_heap/ - Release notes: https://github.com/skuznetsov/pg_sorted_heap/releases/tag/= v0.13.0 - Issues: https://github.com/skuznetsov/pg_sorted_heap/issues --===============3710267551810128770== Content-Type: text/html; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable pg_sorted_heap 0.13.0 released
 

pg_sorted_heap 0.13.0 released

I am pleased to announce pg_sorted_he= ap 0.13.0, a PostgreSQL extension for physically sorted heap storage, zone-map pruning, planner-integrated vector search, and a narrow fact-shaped GraphRAG query surface.

Repository:

https://github.com/skuznetsov/pg_sorted_hea= p

Release:

https://github.com/skuznetsov/pg_sorted_hea= p/releases/tag/v0.13.0

What is pg_sorted_heap?

pg_sorted_heap is a PostgreSQL= extension that adds:

  • sorted_he= ap: a table access method that keeps rows physically ordered by primary key and prunes heap blocks with per-page zone maps.
  • sorted_hn= sw: a planner-integrated HNSW index access method for built-in vector types.
  • svec and hsvec: float32 and float16 vector types for PostgreSQL.=
  • Fact-shaped Gra= phRAG helpers for retrieving and reranking graph-shaped facts directly inside PostgreSQL.

The storage side is aimed at workloads wher= e physical locality matters: time-series data, event logs, IoT readings, ordered IDs, and large tables w= ith range predicates on primary-key columns.

The vector and GraphRAG side is aimed at ap= plications that want retrieval to stay inside PostgreSQL instead of introducing a separate vector-search side= car.

What is new in 0.13.0?

The main change in 0.13.0 is t= hat the narrow fact-shaped GraphRAG contract is now part of the stable release surface.

The stable GraphRAG API includes:

  • sorted_he= ap_graph_rag(...)
  • sorted_he= ap_graph_register(...)
  • sorted_he= ap_graph_config(...)
  • sorted_he= ap_graph_unregister(...)
  • sorted_he= ap_graph_rag_stats()
  • sorted_he= ap_graph_rag_reset_stats()

This contract is intentionally narrow. It i= s designed for fact tables clustered by (entity_id, relation_id, target_id), or by an equivalent re= gistered alias mapping. Queries start with ANN seed retrieval, expand through one or more relation hops, and then exact-rerank the expanded candidate set.

Example:

SELECT *
FROM sorted_heap_graph_rag(
    'facts'::regclass,
    '[0.1,0.2,0.3,...]'::svec,
    relation_path :=3D ARRAY[1, 2],
    ann_k :=3D 64,
    top_k :=3D 10,
    score_mode :=3D 'path'
);

0.13.0 also adds a stable rout= ed GraphRAG entry point for multi-shard or multi-tenant application flows:

  • sorted_he= ap_graph_route(...)
  • sorted_he= ap_graph_route_plan(...)

This gives applications one dispatcher for = exact-key routing, range routing, profiles, policies, and defaults.

Other release highlights

0.13.0 also includes:

  • Schema registra= tion for non-canonical fact tables, so GraphRAG can be used with existing column names.
  • Backend-local G= raphRAG stage stats: seed count, expanded rows, reranked rows, returned rows, and per-stage timing.
  • Lifecycle harde= ning across extension upgrade, dump/restore, crash recovery, concurrent online compact, and concurrent online merge.
  • A shared-cache = correctness fix for sorted_hnsw multi-index workloads.
  • sorted_hn= sw.build_sq8, an opt-in low-memory index-build mode for constrained builders.
  • An experimental= FlashHadamard retrieval lane. This is documented and tested, but it is not the default ANN path and not part of the stable GraphRAG contract.

Benchmark snapshots

These are workload-specific benchmark snaps= hots from the release notes, not universal performance claims.

AWS Gutenberg workload, about 104K x = 2880D, top-10:

  • sorted_hn= sw (svec): 1.287 ms, 100.0% Recall@10
  • sorted_hn= sw (hsvec): 1.404 ms, 100.0% Recall@10
  • pgvector = halfvec: 2.031 ms, 99.8% Recall@10

AWS fact-shaped multihop GraphRAG workload,= 5K chains, 384D:

  • sorted_he= ap_expand_twohop_path_rerank(): median 0.962 ms
  • sorted_he= ap_graph_rag_twohop_path_scan(): median 1.025 ms
  • pgvector parity= row: median 1.434 ms
  • Qdrant parity r= ow: median 3.355 ms

Installation

Requirements:

  • PostgreSQL 17 o= r 18
  • Standard PGXS b= uild toolchain with pg_config in PATH

Build from source:

git clone https://github.com/skuznetsov/pg_sorted_heap.git
cd pg_sorted_heap
make
make install

Enable the extension:

CREATE EXTENSION pg_sorted_heap;

Upgrade an existing installation:

ALTER EXTENSION pg_sorted_heap UPDATE TO '0.13.0';

Minimal examples

Create a physically sorted table:

CREATE TABLE events (
    id      bigint PRIMARY KEY,
    ts      timestamptz,
    payload text
) USING sorted_heap;

SELECT sorted_heap_compact('events'::regclass);

Create a planner-integrated HNSW index:

CREATE TABLE documents (
    id        bigserial PRIMARY KEY,
    embedding svec(384),
    content   text
);

CREATE INDEX documents_embedding_idx
ON documents USING sorted_hnsw (embedding)
WITH (m =3D 16, ef_construction =3D 200);

SET sorted_hnsw.ef_search =3D 96;

SELECT id, content
FROM documents
ORDER BY embedding <=3D> '[0.1,0.2,0.3,...]'::svec
LIMIT 10;

Create a stable fact-shaped GraphRAG table:=

CREATE TABLE facts (
    entity_id   int4,
    relation_id int2,
    target_id   int4,
    embedding   svec(384),
    payload     text,
    PRIMARY KEY (entity_id, relation_id, target_id)
) USING sorted_heap;

CREATE INDEX facts_embedding_idx
ON facts USING sorted_hnsw (embedding)
WITH (m =3D 24, ef_construction =3D 200);

Verification

The 0.13.0 release-candidate c= hecks include:

  • SQL regression = coverage for pg_sorted_heap, sorted_hnsw, and graph_rag
  • GraphRAG lifecy= cle coverage for upgrade and dump/restore
  • crash recovery = checks
  • concurrent onli= ne-operation checks
  • pg_upgrad= e coverage from PostgreSQL 17 to 18
  • sorted_hn= sw chunked/shared-cache integration checks

For local verification:

make test-release

For the narrower GraphRAG release bundle:

make test-graphrag-release

Links

  • Repository: htt= ps://github.com/skuznetsov/pg_sorted_heap
  • Documentation: = https://skuznetsov.github.io/pg_sorted_heap/
  • Release notes: = https://github.com/skuznetsov/pg_sorted_heap/releases/tag/v0.13.0
  • Issues: https:/= /github.com/skuznetsov/pg_sorted_heap/issues
This email was sent to you from Sergey "Computer Mage" Kuznetsov.= It was delivered on their behalf by the PostgreSQL project. Any questions about the content of the message shou= ld be sent to Sergey "Computer Mage" Kuznetsov.

You were sent this email as a subscriber of the pgsql-announce mai= linglist, for the content tag Related Open Source. To unsubscribe from further emails, or change which emails you want to receive, please click th= e personal unsubscribe link that you can find in the headers of this email, or visit https://lists.postgresql.org/unsubscribe/.
 
--===============3710267551810128770==--