mirror of
https://github.com/langchain-ai/langchain-postgres.git
synced 2026-07-16 01:33:18 -04:00
[PGVector] Unnecessary columns queried leads to high latency #84
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @JoshuaPostel on GitHub (Jul 24, 2025).
https://github.com/langchain-ai/langchain-postgres/blob/18b1bcdb75ed152da717e3d624e1ed822d17d60f/langchain_postgres/vectorstores.py#L1419-L1432
This query returns the embedding column which is expensive to deserialize into a python object and AFAICT is not used downstream. From my observations benchmarking against an equivalent query without the embedding column, this costs ~150ms (1024 dimension vector, k=30).
@averikitsch commented on GitHub (Aug 8, 2025):
The new PGVectorStore interface includes this improvement.