LightRAG/lightrag/kg
Yasiru Rangana 8a72135a32 Optimize PostgreSQL initialization performance
- Batch index existence checks into single query (16+ queries -> 1 query)
- Batch timestamp column checks into single query (8 queries -> 1 query)
- Batch field length checks into single query (5 queries -> 1 query)

Performance improvement: ~70-80% faster initialization (35s -> 5-10s)

Key optimizations:
1. check_tables(): Use ANY($1) to check all indexes at once
2. _migrate_timestamp_columns(): Batch all column type checks
3. _migrate_field_lengths(): Batch all field definition checks

All changes are backward compatible with no schema or API changes.
Reduces database round-trips by batching information_schema queries.

(cherry picked from commit 2f22336ace)
2025-12-04 19:09:00 +08:00
..
deprecated Preserve ordering in get_by_ids methods across all storage implementations 2025-12-04 19:06:54 +08:00
__init__.py Remove deprecated storage 2025-08-06 00:02:50 +08:00
faiss_impl.py tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00
graph_tenant_support.py tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00
json_doc_status_impl.py Preserve ordering in get_by_ids methods across all storage implementations 2025-12-04 19:06:54 +08:00
json_kv_impl.py tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00
memgraph_impl.py tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00
milvus_impl.py Preserve ordering in get_by_ids methods across all storage implementations 2025-12-04 19:06:54 +08:00
mongo_impl.py Preserve ordering in get_by_ids methods across all storage implementations 2025-12-04 19:06:54 +08:00
mongo_tenant_support.py tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00
nano_vector_db_impl.py Preserve ordering in get_by_ids methods across all storage implementations 2025-12-04 19:06:54 +08:00
neo4j_impl.py tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00
networkx_impl.py Fixed typo in log message when creating new graph file 2025-12-04 19:05:35 +08:00
postgres_impl.py Optimize PostgreSQL initialization performance 2025-12-04 19:09:00 +08:00
postgres_rls.sql tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00
postgres_tenant_support.py tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00
qdrant_impl.py Preserve ordering in get_by_ids methods across all storage implementations 2025-12-04 19:06:54 +08:00
redis_impl.py Preserve ordering in get_by_ids methods across all storage implementations 2025-12-04 19:06:54 +08:00
redis_tenant_support.py tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00
shared_storage.py tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00
vector_tenant_support.py tests: stabilize integration tests + skip external services; fix multi-tenant API behavior and idempotency (#4) 2025-12-04 16:04:21 +08:00