docs: clarify prewarm modes and publish SDK examples

This commit is contained in:
ChilePiquin
2026-11-14 07:18:37 -08:00
parent ecc52a0597
commit eaa160c1b7
4 changed files with 138 additions and 16 deletions
+40 -2
View File
@@ -1060,8 +1060,8 @@ Prewarm one or more columns of data in the table.
This will load the column data into the page cache so that future queries that
read those columns avoid the initial cold-start latency. This call initiates
prewarming and returns once the request is accepted; the warming itself may
continue in the background. Calling it on already-prewarmed columns is a
no-op on the server.
continue in the background. Submission uses SQL PREWARM and needs Flight
SQL connectivity. Use [prewarmDataAsync](Table.md#prewarmdataasync) to retain the job handle.
Prewarming is generally useful for columns used in filters or projections.
Large columns (e.g. high-dimensional vectors or binary data) may not be
practical to prewarm.
@@ -1073,6 +1073,44 @@ Prewarm one or more columns of data in the table.
***
### prewarmDataAsync()
```ts
abstract prewarmDataAsync(options?): Promise<Job>
```
Submit data prewarm through SQL and return its durable warming-job handle.
The table handle supplies the branch and namespace. Requires a compatible
SQL PREWARM server and Flight SQL connectivity. Standard authorization
requires table Select and database/namespace Usage. Status/wait use generic
HTTP job APIs; events and cancellation retain their own privileges.
No REST fallback or option-dropping retry is performed. Historical-version
handles are unsupported; call `checkoutLatest()` first.
Submission returns after acceptance. Use `job.wait()` for completion, or
save `job.id` and reopen it with `db.openJob(id)`. A timeout does not cancel
the job. After `job.refresh()`, `job.spec.table_version` is the pinned version.
#### Parameters
* **options?**: [`PrewarmDataOptions`](../interfaces/PrewarmDataOptions.md)
#### Returns
`Promise`&lt;[`Job`](Job.md)&gt;
#### Example
```ts
const job = await table.prewarmDataAsync({
columns: ["video"], filter: "quality > 0.7", concurrency: 4,
});
await job.wait();
```
***
### prewarmIndex()
```ts
+1
View File
@@ -125,6 +125,7 @@
- [OpenTableOptions](interfaces/OpenTableOptions.md)
- [OptimizeOptions](interfaces/OptimizeOptions.md)
- [OptimizeStats](interfaces/OptimizeStats.md)
- [PrewarmDataOptions](interfaces/PrewarmDataOptions.md)
- [QueryExecutionOptions](interfaces/QueryExecutionOptions.md)
- [RTEStats](interfaces/RTEStats.md)
- [RTEWriteSpec](interfaces/RTEWriteSpec.md)
@@ -0,0 +1,39 @@
[**@lancedb/lancedb**](../README.md) • **Docs**
***
[@lancedb/lancedb](../globals.md) / PrewarmDataOptions
# Interface: PrewarmDataOptions
Settings for submitting a durable remote data-cache prewarm job.
## Properties
### columns?
```ts
optional columns: string[];
```
Lance field paths to warm; omitted or empty means every column.
***
### concurrency?
```ts
optional concurrency: number;
```
Positive per-executor concurrency, at most 4294967295.
***
### filter?
```ts
optional filter: string;
```
A single SQL predicate for conservative metadata pruning.