Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: cutecutecat <junyuchen@tensorchord.ai>
  • Loading branch information
cutecutecat committed Jan 19, 2024
1 parent ed18755 commit c7db97a
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/usage/compatibility.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
# Compatible with pgvector
# Pgvector compatibility

pgvecto.rs can be configured to be compatible with `pgvector` at:
Pgvecto.rs is natively compatible with pgvector at:
- Create table
- Create vector indexes
- Search vectors

For `create table` and `search vectors`, pgvecto.rs supports this feature natively.
Pgvecto.rs can be configured to be compatible with pgvector at:
- Create vector indexes

For `create vector indexes' this feature should be enabled with `SET vectors.pgvector_compat=on;`.
This feature is called `compatibility mode`.

It can be enabled with `SET vectors.pgvector_compatibility=on;`.

## Examples

It's easy to enable compatibility mode and run a search.
It's easy to enable compatibility mode and start a vector search.
```sql
DROP TABLE IF EXISTS t;
SET vectors.pgvector_compat=on;
Expand All @@ -23,7 +24,7 @@ SELECT COUNT(1) FROM (SELECT 1 FROM t ORDER BY val <-> '[0.5,0.5,0.5]' limit 100
DROP INDEX hnsw_l2_index;
```

Multiply types of indices are accepted:
Multiply types of indexes are accepted:
```sql
SET vectors.pgvector_compat=on;
-- [hnsw + vector_l2_ops] index with default options
Expand All @@ -48,7 +49,7 @@ For compatibility, we strive to maintain a consistent user experience, but there
- Some features of pgvector are different in `compatibility mode

### Unavailable features of pgvecto.rs
When pgvecto.rs is running in `compatibility mode`, some features of pgvecto.rs are not available:
When executing SQL statements in `compatibility mode', some features of pgvecto.rs are not accessible:
- `flat` index
- Quantization, including `scalar quantization` and `product quantization`
- prefilter and vbase
Expand All @@ -74,6 +75,6 @@ Options for `hnsw`.
Although in `compatibility mode', there are still differences from pgvector.

Known problems are not limited to:
- Create vector indexes is asynchronous at pgvecto.rs, instead of synchronous at pgvector
- Query Options [ivfflat.probes](https://github.com/pgvector/pgvector#query-options-1) need to be `vectors.ivf_nprobe`, and [hnsw.ef_search](https://github.com/pgvector/pgvector?tab=readme-ov-file#query-options) need to be `vectors.hnsw_ef_search`
- [Vector Functions](https://github.com/pgvector/pgvector?tab=readme-ov-file#vector-functions) and [Aggregate Functions](https://github.com/pgvector/pgvector?tab=readme-ov-file#aggregate-functions) are not supported
- Create vector indexes is asynchronous at pgvecto.rs, instead of synchronous at pgvector
- All other modules except index are not supported

0 comments on commit c7db97a

Please sign in to comment.