Prerequisites

  • PostgreSQL 11, 12, 13, 14, 15 or 16

Supported platforms

  • Linux (x86_64)
  • Mac (intel)

Use our releases from GitHub.

Installation

cd /tmp
LDB_VERSION=0.0.5
wget "https://github.com/lanterndata/lantern/releases/download/v${LDB_VERSION}/lantern-${LDB_VERSION}.tar"
tar xf "lantern-${LDB_VERSION}.tar"
cd "lantern-${LDB_VERSION}"
make install
You can replace 0.0.5 with the version you want to install

Test

CREATE EXTENSION lantern;
CREATE TABLE lantern_demo (id SERIAL, v REAL[3]);
INSERT INTO lantern_demo (v) VALUES ('{0, 0, 0}'), ('{0, 1, 0}'), ('{1, 0, 0}');
CREATE INDEX ON lantern_demo USING hnsw(v) WITH (m=4, ef_construction=8);
SET enable_seqscan=off; -- to always use index on scan
SELECT * FROM lantern_demo ORDER BY v <-> ARRAY[1,1,1];