From 610d95b8d20d271462ae7f9b627ead3a0e279001 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Sun, 26 Apr 2026 13:12:28 -0700 Subject: [PATCH] Moved scaling section [skip ci] --- README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index ad19a3d..4fbab03 100644 --- a/README.md +++ b/README.md @@ -744,6 +744,17 @@ REINDEX INDEX CONCURRENTLY index_name; VACUUM table_name; ``` +## Scaling + +Scale vertically by increasing memory, CPU, and storage on a single instance. Use existing tools to [tune parameters](#tuning) and [monitor performance](#monitoring). + +For a smaller working set: + +1. Use the `halfvec` type instead of `vector` for tables +2. Use [binary quantization](#binary-quantization) for indexes (with re-ranking for search) + +Scale horizontally with [replicas](https://www.postgresql.org/docs/current/hot-standby.html), or use [Citus](https://github.com/citusdata/citus) or another approach for sharding ([example](https://github.com/pgvector/pgvector-python/blob/master/examples/citus/example.py)). + ## Monitoring Monitor performance with [pg_stat_statements](https://www.postgresql.org/docs/current/pgstatstatements.html) (be sure to add it to `shared_preload_libraries`). @@ -769,17 +780,6 @@ SELECT ... COMMIT; ``` -## Scaling - -Scale vertically by increasing memory, CPU, and storage on a single instance. Use existing tools to [tune parameters](#tuning) and [monitor performance](#monitoring). - -For a smaller working set: - -1. Use the `halfvec` type instead of `vector` for tables -2. Use [binary quantization](#binary-quantization) for indexes (with re-ranking for search) - -Scale horizontally with [replicas](https://www.postgresql.org/docs/current/hot-standby.html), or use [Citus](https://github.com/citusdata/citus) or another approach for sharding ([example](https://github.com/pgvector/pgvector-python/blob/master/examples/citus/example.py)). - ## Languages Use pgvector from any language with a Postgres client. You can even generate and store vectors in one language and query them in another.