Files
lancedb/docs/web/search/realtime-read.mdx
T
Jack YeandClaude Sonnet 5 5e38120bdc docs: add storage integration SDK examples, abstract RTE write, simplify cache pages (#4865)
## Summary

- **Define Storage Integration**: un-gates the Python (and Rust, for S3)
`create_storage_integration` examples, drafted against #4618 and held
back until it shipped -- it's now in v0.42.0-beta.0+, and the signature
matches the drafts exactly.
- **Naming rules**: drops the `Branch` row and its "Learn more" link,
consistent with de-emphasizing branches elsewhere in this nav.
- **Distributed RTE Write**: removes the REST path, the
`__lance_mem_wal` index name, and "WAL node" terminology in favor of an
abstract framing -- a query node routes writes to RTE nodes, each of
which can host shards from many different tables. Both diagram variants
are updated to match.
- **Data Page Cache / Tiered Index Cache / Cache Prewarm**: drop
Helm-specific and exact-percentage detail (disk-budget math,
`startup_prewarm_block_query_ready`/`healthPort`/failure-policy table)
in favor of a short feature → architecture → why-it-matters shape, each
closing with a contact-sales pointer. Data Page Cache's on-demand
prewarm section is removed outright.

## Note

I wasn't able to get a clean visual render of the updated Distributed
RTE Write diagram in local preview -- Mermaid isn't rendering in
headless Chrome in this environment for *any* page right now, confirmed
against an unmodified reference page showing the identical symptom. The
diagram source follows the exact pattern already shipped and working in
the 21 diagrams from the earlier brand-theming pass, and `mint
validate`/`mint broken-links` both pass clean.

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-05 01:40:54 -08:00

85 lines
4.1 KiB
Plaintext

---
title: "RTE reads"
sidebarTitle: "RTE Read"
description: "Query a table with the real time engine enabled and get writes back within milliseconds of being written, merged transparently with the base table."
icon: "magnifying-glass"
keywords: ["rte", "real time engine", "real time search", "real time query", "fresh reads", "memwal", "upsert"]
availability:
embedded: available
enterprise: available
---
A table with the [real time engine](/tables/realtime-engine) enabled queries
the same way as any other table — nothing about `search`, filtering, or SQL
changes. This page covers what you get back; for enabling RTE and writing to
a table, see [RTE writes](/ingestion/realtime-write). For how Enterprise
combines these results across machines, see
[Distributed RTE Read](/enterprise/distributed-real-time-read).
## Query a real time table {#query}
Every query runs against the base table and the fresh tier (unflushed
memtables and SSTables) in parallel, and the two are merged into one result.
Fresh rows supersede base rows with the same primary key, so a row written a
moment ago is already reflected:
<CodeGroup>
```python Python icon="python"
# continuing the `frames` table connected and written to in RTE writes
import numpy as np
query_vector = np.random.rand(frames.schema.field("embedding").type.list_size).astype("float32")
frames.search(query_vector, vector_column_name="embedding").limit(10).to_list()
frames.search("gripper closing on a cup", fts_columns="caption").limit(10).to_list()
```
</CodeGroup>
By default every index on the table is RTE-maintained, re-read as the table
changes, so a new index is picked up automatically; pin a smaller set with
`RTEWriteSpec.with_maintained_indexes`. For full-text and scalar (BTree,
bitmap) indexes, a maintained index covers every tier -- base table,
SSTables, and the active memtable -- so a query rejects outright rather than
silently skipping un-compacted rows if a resident memtable predates the
index. Vector (ANN) search is maintained on the base table and SSTables the
same way, and the active memtable builds its own in-memory HNSW graph as
rows land, so writes stay vector-searchable within milliseconds too,
without waiting on a freeze into an SSTable. That graph search steps aside
for a full scan of the memtable only when it can't honor the query through
a graph -- a prefilter, a primary-key override, a distance lower bound, or
before the memtable has any index yet on a cold start.
## Embedded: one process, one dataset {#embedded}
LanceDB Embedded runs this same LSM scanner directly against the local Lance
dataset, in-process -- the identical merge-by-primary-key logic, the same
maintained-index rules for vector, full-text, and scalar search, just with no
network hop to a separate serving tier. There is no WAL node to route to and
nothing to combine across machines: a query against an RTE-enabled Embedded
table already reads the fresh tier together with the base table in one call.
See [Distributed RTE Read](/enterprise/distributed-real-time-read) for
what Enterprise adds on top when that fresh tier is served by a separate
machine from the one answering the rest of the query.
Not every query shape runs through the LSM scanner -- a query that asks for
`with_row_id`, time travel, multiple query vectors, hybrid search, or a
handful of other combinations is rejected with a clear error asking you to
set `use_rte(False)` and read the base table only, rather than silently
returning a result that omits un-compacted rows.
## Limitations {#limitations}
<Note>
Support for all table operations on RTE tables is coming soon. Time travel,{/* Draft until branching reaches early access: restore " branching," */}
`count_rows`, row IDs (`with_row_id`), and `TABLESAMPLE` are not yet
available.
</Note>
## Next steps {#next-steps}
- [RTE writes](/ingestion/realtime-write) — enable RTE and write to a table
- [Distributed RTE Read](/enterprise/distributed-real-time-read) — combining results across machines in Enterprise
- [How the real time engine works](/tables/realtime-engine#memwal-format)
- [Hybrid search](/search/hybrid-search)
- [Vector search](/search/vector-search)