-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'georgia-tech-db:feature/remote_indexes' into feature/ze…
…ro-vector-opt
- Loading branch information
Showing
9 changed files
with
268 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<div class="relative overflow-hidden shadow-md rounded-lg"> | ||
<table class="table-fixed w-full text-left"> | ||
<thead class="uppercase bg-[#4666a7] text-[#ffffff]" style="background-color: #4666a7; color: #ffffff;"> | ||
<tr> | ||
<td class="py-1 border text-center p-4" contenteditable="true"> | ||
<br> | ||
</td> | ||
<td class="py-1 border text-center p-4" contenteditable="true">PGVECTOR</td> | ||
<td class="py-1 border text-center p-4" contenteditable="true">PINECONE</td> | ||
<td class="py-1 border text-center p-4" contenteditable="true">PGVECTOR-REMOTE</td> | ||
</tr> | ||
</thead> | ||
<tbody class="bg-white text-gray-500 bg-[#FFFFFF] text-[#0f2e6c]" style="background-color: #FFFFFF; color: #0f2e6c;"> | ||
<tr class="py-5"> | ||
<td class="py-5 border text-center font-bold p-4" contenteditable="true">SQL Interface | ||
<br> | ||
</td> | ||
<td class="py-5 border text-center font-bold p-4" contenteditable="true"><code>✔</code> | ||
|
||
</td> | ||
<td class="py-5 border text-center font-bold p-4" contenteditable="true"> | ||
<br> | ||
</td> | ||
<td class="py-5 border text-center font-bold p-4" contenteditable="true"><code>✔</code> | ||
|
||
</td> | ||
</tr> | ||
<tr class="py-5"> | ||
<td class="py-5 border text-center font-bold p-4" contenteditable="true">Transaction Support | ||
<br> | ||
</td> | ||
<td class="py-5 border text-center font-bold p-4" contenteditable="true"><code>✔</code> | ||
|
||
</td> | ||
<td class="py-5 border text-center font-bold p-4" contenteditable="true"></td> | ||
<td class="py-5 border text-center font-bold p-4" contenteditable="true"><code>✔</code> | ||
|
||
</td> | ||
</tr> | ||
<tr class="py-5"> | ||
<td class="py-5 border text-center font-bold p-4" contenteditable="true">10+ Client Languages | ||
<br> | ||
</td> | ||
<td class="py-5 border text-center font-bold p-4" contenteditable="true"><code>✔</code> | ||
|
||
</td> | ||
<td class="py-5 border text-center font-bold p-4" contenteditable="true"></td> | ||
<td class="py-5 border text-center font-bold p-4" contenteditable="true"><code>✔</code> | ||
|
||
</td> | ||
</tr> | ||
<tr class="py-5"> | ||
<td class="py-5 border text-center font-bold p-4" contenteditable="true">Data Export | ||
<br> | ||
</td> | ||
<td class="py-5 border text-center font-bold p-4" contenteditable="true"><code>✔</code> | ||
|
||
</td> | ||
<td class="py-5 border text-center font-bold p-4" contenteditable="true"> | ||
<br> | ||
</td> | ||
<td class="py-5 border text-center font-bold p-4" contenteditable="true"><code>✔</code> | ||
|
||
</td> | ||
</tr> | ||
<tr class="py-5"> | ||
<td class="py-5 border text-center font-bold p-4" contenteditable="true">Latency*</td> | ||
<td class="py-5 border text-center font-bold p-4" contenteditable="true">300ms</td> | ||
<td class="py-5 border text-center font-bold p-4" contenteditable="true">4ms</td> | ||
<td class="py-5 border text-center font-bold p-4" contenteditable="true">7ms</td> | ||
</tr> | ||
<tr class="py-5"> | ||
<td class="py-5 border text-center font-bold p-4" contenteditable="true">Throughput*</td> | ||
<td class="py-5 border text-center font-bold p-4" contenteditable="true">3QPS</td> | ||
<td class="py-5 border text-center font-bold p-4" contenteditable="true">300QPS</td> | ||
<td class="py-5 border text-center font-bold p-4" contenteditable="true">300QPS</td> | ||
</tr> | ||
<tr class="py-5"> | ||
<td class="py-5 border text-center font-bold p-4" contenteditable="true">Metadata Filtering | ||
<br> | ||
</td> | ||
<td class="py-5 border text-center font-bold p-4" contenteditable="true"></td> | ||
<td class="py-5 border text-center font-bold p-4" contenteditable="true"><code>✔</code> | ||
|
||
</td> | ||
<td class="py-5 border text-center font-bold p-4" contenteditable="true"><code>✔</code> | ||
|
||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,86 @@ | ||
delete from pinecone_mock; | ||
SET client_min_messages = 'notice'; | ||
SET enable_seqscan = off; | ||
-- flush each vector individually | ||
SET pinecone.vectors_per_request = 1; | ||
SET pinecone.requests_per_batch = 1; | ||
-- CREATE TABLE | ||
CREATE TABLE t (val vector(3)); | ||
-- mock create index | ||
INSERT INTO pinecone_mock (url_prefix, method, response) | ||
VALUES ('https://api.pinecone.io/indexes', 'POST', $${ | ||
"name": "invalid", | ||
"metric": "euclidean", | ||
"dimension": 3, | ||
"status": { | ||
"ready": true, | ||
"state": "Ready" | ||
}, | ||
"host": "fakehost", | ||
"spec": { | ||
"serverless": { | ||
"cloud": "aws", | ||
"region": "us-west-2" | ||
} | ||
} | ||
}$$); | ||
-- mock describe index stats | ||
INSERT INTO pinecone_mock (url_prefix, method, response) | ||
VALUES ('https://fakehost/describe_index_stats', 'GET', '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}'); | ||
-- create index | ||
CREATE INDEX i2 ON t USING pinecone (val vector_l2_ops) WITH (spec = '{"serverless":{"cloud":"aws","region":"us-west-2"}}'); | ||
-- mock upsert | ||
INSERT INTO pinecone_mock (url_prefix, method, response) VALUES ('https://fakehost/vectors/upsert', 'POST', '{"upsertedCount":1}'); | ||
INSERT INTO t (val) VALUES ('[1,0,0]'); | ||
INSERT INTO t (val) VALUES ('[1,0,1]'); | ||
INSERT INTO t (val) VALUES ('[1,1,0]'); | ||
EXPLAIN SELECT val,val<->'[1,1,1]' as dist FROM t ORDER BY val <-> '[1, 1, 1]'; | ||
QUERY PLAN | ||
---------------------------------------------------------------- | ||
Index Scan using i2 on t (cost=0.00..7.41 rows=1360 width=40) | ||
Order By: (val <-> '[1,1,1]'::vector) | ||
(2 rows) | ||
|
||
EXPLAIN SELECT val,val<=>'[1,1,1]' as dist FROM t ORDER BY val <=> '[1, 1, 1]'; | ||
QUERY PLAN | ||
------------------------------------------------------------------------------- | ||
Sort (cost=10000000097.78..10000000101.18 rows=1360 width=40) | ||
Sort Key: ((val <=> '[1,1,1]'::vector)) | ||
-> Seq Scan on t (cost=10000000000.00..10000000027.00 rows=1360 width=40) | ||
(3 rows) | ||
|
||
DROP INDEX i2; | ||
INSERT INTO pinecone_mock (url_prefix, method, response) | ||
VALUES ('https://api.pinecone.io/indexes', 'POST', $${ | ||
"name": "invalid", | ||
"metric": "cosine", | ||
"dimension": 3, | ||
"status": { | ||
"ready": true, | ||
"state": "Ready" | ||
}, | ||
"host": "fakehost", | ||
"spec": { | ||
"serverless": { | ||
"cloud": "aws", | ||
"region": "us-west-2" | ||
} | ||
} | ||
}$$); | ||
CREATE INDEX i3 ON t USING pinecone (val vector_cosine_ops) WITH (spec = '{"serverless":{"cloud":"aws","region":"us-west-2"}}'); | ||
CREATE INDEX i1 ON t USING pinecone (val vector_ip_ops) WITH (spec = '{"serverless":{"cloud":"aws","region":"us-west-2"}}'); | ||
EXPLAIN SELECT val,val<=>'[1,1,1]' as dist FROM t ORDER BY val <=> '[1, 1, 1]'; | ||
QUERY PLAN | ||
------------------------------------------------------------- | ||
Index Scan using i3 on t (cost=0.00..4.02 rows=3 width=40) | ||
Order By: (val <=> '[1,1,1]'::vector) | ||
(2 rows) | ||
|
||
EXPLAIN SELECT val,val<->'[1,1,1]' as dist FROM t ORDER BY val <-> '[1, 1, 1]'; | ||
QUERY PLAN | ||
---------------------------------------------------------------------------- | ||
Sort (cost=10000000001.06..10000000001.07 rows=3 width=40) | ||
Sort Key: ((val <-> '[1,1,1]'::vector)) | ||
-> Seq Scan on t (cost=10000000000.00..10000000001.04 rows=3 width=40) | ||
(3 rows) | ||
|
||
DROP TABLE t; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
SET enable_seqscan = off; | ||
SET client_min_messages = 'notice'; | ||
ALTER SYSTEM RESET pinecone.api_key; | ||
SELECT pg_reload_conf(); | ||
CREATE TABLE t (val vector(3)); | ||
CREATE INDEX i2 ON t USING pinecone (val) WITH (spec = '{"serverless":{"cloud":"aws","region":"us-west-2"}}'); | ||
ALTER SYSTEM SET pinecone.api_key = '5b2c1031-ba58-4acc-a634-9f943d68822c'; | ||
ALTER SYSTEM SET pinecone.api_key = 'fake-key'; | ||
SELECT pg_reload_conf(); | ||
CREATE INDEX i2 ON t USING pinecone (val); | ||
DROP TABLE t; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,60 @@ | ||
delete from pinecone_mock; | ||
SET client_min_messages = 'notice'; | ||
SET enable_seqscan = off; | ||
-- flush each vector individually | ||
SET pinecone.vectors_per_request = 1; | ||
SET pinecone.requests_per_batch = 1; | ||
-- CREATE TABLE | ||
CREATE TABLE t (val vector(3)); | ||
-- mock create index | ||
INSERT INTO pinecone_mock (url_prefix, method, response) | ||
VALUES ('https://api.pinecone.io/indexes', 'POST', $${ | ||
"name": "invalid", | ||
"metric": "euclidean", | ||
"dimension": 3, | ||
"status": { | ||
"ready": true, | ||
"state": "Ready" | ||
}, | ||
"host": "fakehost", | ||
"spec": { | ||
"serverless": { | ||
"cloud": "aws", | ||
"region": "us-west-2" | ||
} | ||
} | ||
}$$); | ||
-- mock describe index stats | ||
INSERT INTO pinecone_mock (url_prefix, method, response) | ||
VALUES ('https://fakehost/describe_index_stats', 'GET', '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}'); | ||
-- create index | ||
CREATE INDEX i2 ON t USING pinecone (val vector_l2_ops) WITH (spec = '{"serverless":{"cloud":"aws","region":"us-west-2"}}'); | ||
-- mock upsert | ||
INSERT INTO pinecone_mock (url_prefix, method, response) VALUES ('https://fakehost/vectors/upsert', 'POST', '{"upsertedCount":1}'); | ||
INSERT INTO t (val) VALUES ('[1,0,0]'); | ||
INSERT INTO t (val) VALUES ('[1,0,1]'); | ||
INSERT INTO t (val) VALUES ('[1,1,0]'); | ||
EXPLAIN SELECT val,val<->'[1,1,1]' as dist FROM t ORDER BY val <-> '[1, 1, 1]'; | ||
EXPLAIN SELECT val,val<=>'[1,1,1]' as dist FROM t ORDER BY val <=> '[1, 1, 1]'; | ||
DROP INDEX i2; | ||
INSERT INTO pinecone_mock (url_prefix, method, response) | ||
VALUES ('https://api.pinecone.io/indexes', 'POST', $${ | ||
"name": "invalid", | ||
"metric": "cosine", | ||
"dimension": 3, | ||
"status": { | ||
"ready": true, | ||
"state": "Ready" | ||
}, | ||
"host": "fakehost", | ||
"spec": { | ||
"serverless": { | ||
"cloud": "aws", | ||
"region": "us-west-2" | ||
} | ||
} | ||
}$$); | ||
CREATE INDEX i3 ON t USING pinecone (val vector_cosine_ops) WITH (spec = '{"serverless":{"cloud":"aws","region":"us-west-2"}}'); | ||
CREATE INDEX i1 ON t USING pinecone (val vector_ip_ops) WITH (spec = '{"serverless":{"cloud":"aws","region":"us-west-2"}}'); | ||
EXPLAIN SELECT val,val<=>'[1,1,1]' as dist FROM t ORDER BY val <=> '[1, 1, 1]'; | ||
EXPLAIN SELECT val,val<->'[1,1,1]' as dist FROM t ORDER BY val <-> '[1, 1, 1]'; | ||
DROP TABLE t; |