mirror of
https://github.com/lancedb/lancedb.git
synced 2025-12-23 05:19:58 +00:00
## Summary - Exposes `Session` in Python and Typescript so users can set the `index_cache_size_bytes` and `metadata_cache_size_bytes` * The `Session` is attached to the `Connection`, and thus shared across all tables in that connection. - Adds deprecation warnings for table-level cache configuration 🤖 Generated with [Claude Code](https://claude.ai/code) --------- Co-authored-by: Claude <noreply@anthropic.com>
1.4 KiB
1.4 KiB
@lancedb/lancedb • Docs
@lancedb/lancedb / Session
Class: Session
A session for managing caches and object stores across LanceDB operations.
Sessions allow you to configure cache sizes for index and metadata caches, which can significantly impact performance for large datasets.
Constructors
new Session()
new Session(indexCacheSizeBytes?, metadataCacheSizeBytes?): Session
Create a new session with custom cache sizes.
Parameters
index_cache_size_bytes: The size of the index cache in bytes. Defaults to 6GB if not specified.metadata_cache_size_bytes: The size of the metadata cache in bytes. Defaults to 1GB if not specified.
Parameters
-
indexCacheSizeBytes?:
null|bigint -
metadataCacheSizeBytes?:
null|bigint
Returns
Methods
approxNumItems()
approxNumItems(): number
Get the approximate number of items cached in the session.
Returns
number
sizeBytes()
sizeBytes(): bigint
Get the current size of the session caches in bytes.
Returns
bigint
default()
static default(): Session
Create a session with default cache sizes.
This is equivalent to creating a session with 6GB index cache and 1GB metadata cache.