Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ All the database client supported
| tencent_es | `pip install vectordb-bench[tencent_es]` |
| alisql | `pip install vectordb-bench[alisql]` |
| polardb | `pip install vectordb-bench[polardb]` |
| polardb_pg | `pip install vectordb-bench[pgvector]` |
| doris | `pip install vectordb-bench[doris]` |
| zvec | `pip install vectordb-bench[zvec]` |
| endee | `pip install vectordb-bench[endee]` |
Expand Down Expand Up @@ -116,6 +117,7 @@ Options:
--help Show this message and exit.

Commands:
polardbpghnsw
pgvectorhnsw
pgvectorivfflat
vectorchordrq
Expand Down Expand Up @@ -263,6 +265,47 @@ Options:
--help Show this message and exit.
```

### Run polardb_pg from command line

polardb_pg supports HNSW with PQ, SQ4, SQ8, RaBitQ, and Graph Cache.
This PostgreSQL client is separate from the existing MySQL-compatible PolarDB
commands and reuses the `pgvector` dependency extra:

```shell
pip install 'vectordb-bench[pgvector]'
```

PolarDB-specific internal quantization and Graph Cache options require PolarDB
vector extension 0.8.3.1 or later. Use `--skip-graph-cache` when Graph Cache is
not configured on the server.

**Example: Run hnsw index test**

```shell
vectordbbench polardbpghnsw \
--case-type Performance1024D1M \
--db-label polardb-pg-rabitq8 \
--user-name postgres --password '<password>' \
--host localhost --port 5432 --db-name vectordb \
--m 16 --ef-construction 256 --ef-search 200 \
--quantization rabitq --quantization-nbits 8 \
--iterative-scan off --graph-cache
```

To list the options for polardb_pg, execute
`vectordbbench polardbpghnsw --help`. The following are some PolarDB-specific
command-line options.

```text
--quantization [pq|sq4|sq8|rabitq]
--pq-m INTEGER
--train-samples INTEGER
--quantization-nbits [1|4|8]
--graph-cache / --skip-graph-cache
--graph-cache-timeout INTEGER
--iterative-scan [off|strict_order|relaxed_order]
```

### Run VectorChord (vchordrq) from command line

VectorChord is a PostgreSQL extension for scalable vector similarity search using IVF + RaBitQ indexing.
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ test = [
"black",
"ruff",
"pytest",
"psycopg",
"psycopg-binary",
"pgvector",
]
restful = [ "flask" ]
qdrant = [ "qdrant-client" ]
Expand All @@ -63,7 +66,7 @@ elastic = [ "elasticsearch" ]
# For elastic and aliyun_elasticsearch

pgvector = [ "psycopg", "psycopg-binary", "pgvector" ]
# for pgvector, pgvectorscale, pgdiskann, alloydb, and lakebase_vector
# for pgvector, pgvectorscale, pgdiskann, alloydb, lakebase_vector, and PolarDB for PostgreSQL HNSW

pgvecto_rs = [ "pgvecto_rs[psycopg3]>=0.2.2" ]
redis = [ "redis" ]
Expand Down
Loading