Files
lancedb/docs/web/sql/dql/ivf-partition.mdx
T
Jack YeandClaude Sonnet 5 de95ed3f6d docs: overhaul curation, feature engineering, security and deployment guides (#4748)
A broad documentation pass across the areas LanceDB Enterprise and
Embedded
diverge on most:

**Data Curation** -- GPU Function execution, Slurm scheduling (and what
Slurm is, for readers new to it), blob late materialization as its own
page, joins, aggregation/profiling, sampling, near-duplicate detection,
chunking, distributed shuffle, and IVF-partition clustering.

**Feature Engineering** -- computed columns and materialized views,
restructured to lead with the Function-based path and show the SQL form
side by side with Python throughout; a single Auto Refresh page instead
of
duplicating scheduling details on every refresh page; adaptive
execution;
checkpointing; GPU and Slurm placement for refresh workers; a Training
Cache page for the PyTorch data loader's automatic cache benefit.

**Security & Governance** -- an Audit Log reference (schema, access,
grants), Secrets promoted to an ordinary catalog object with their own
SQL
DDL and a vending/rotation guide, and privilege-table fixes verified
against the authorization source.

**Deployment & Maintenance** -- Horizontal Scaling and OpenTelemetry
moved
into a real Deployment area; Automated Cleanup folded into Intelligent
Auto-Maintenance (every other maintenance decision already lived there);
RTE Compaction and Advanced Conflict Resolution documented in depth.

**Landing page** -- the Enterprise feature comparison table reorganized
(several redundant or stale rows removed, several new areas added), and
the
"why Enterprise" bullets replaced with ones tied to a concrete page
(Performance, Scale, Fault tolerance, Multicloud deployment, Simplify
operations) instead of vague promises.

Plus a full pass addressing lancedb-gatekeeper's review: a real
test-safety
bug (a quickstart test could silently overwrite and delete a
deployment's
own `frames` table), a fabricated SQL statement with no backing
implementation, an actual dedup-guarantee bug in `take_row_ids`, and
dozens
of documentation-accuracy fixes verified against source rather than
taken
on faith -- each either fixed, or left with an explicit note on why it
needs a feature or deployment owner's sign-off instead of being guessed
at.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_018PXMCbRH6i5w47TsjeEUMT

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-03 16:17:24 -08:00

60 lines
2.5 KiB
Plaintext

---
title: "IVF_PARTITION"
sidebarTitle: "IVF_PARTITION"
description: "The ivf_partition() scalar function: assign each row to its trained IVF index partition."
icon: circle-nodes
keywords: ["ivf_partition", "sql", "vector index", "ivf", "partition", "scalar function", "clustering", "blocking"]
availability:
embedded: unavailable
enterprise: available
---
<CodeGroup>
```sql SQL icon="database"
SELECT
ivf_partition(embedding, selection => 'random', count => 100, seed => 42) AS partition,
array_agg(id) AS ids
FROM documents
GROUP BY partition
```
</CodeGroup>
`ivf_partition` reads an existing IVF-family vector index's trained
partitions and assigns each row to the one its vector falls into. The column
needs an up-to-date, single-segment index before the function runs -- the
same requirement [`dedupe`](/curation/dedupe#example-data) has.
Grouping by its result buckets rows by vector proximity without a full
pairwise scan -- useful for blocking a large table into comparable chunks,
such as before a pairwise similarity pass.
## Input {#input}
`ivf_partition` takes exactly 1, 3, or 4 arguments -- the vector column
alone (scans every partition), or the vector column plus `selection` and
`count`, plus `seed` only when `selection` is `'random'`:
| Argument | Type | Required | Meaning |
| --- | --- | --- | --- |
| vector column | column reference | yes | the indexed vector column to assign |
| `selection` | `'first'` \| `'random'` | required with `count` | which partitions to sample -- there is no explicit `'all'`; omit `selection` and `count` entirely to scan every partition |
| `count` | int, > 0 | required with `selection` | number of partitions to sample |
| `seed` | int, >= 0 | required for `'random'`, refused for `'first'` | random seed |
Arguments can be passed positionally, `ivf_partition(embedding, 'random', 100, 42)`,
or named as shown above. `count` and `seed` are the same scan-scoping
arguments [`duplicate_pairs`](/sql/dql/duplicate-pairs#sampling) accepts,
so a sampled partition estimate carries over -- but not `dedupe`, which
always scans every partition and refuses sampling arguments entirely.
## What to read next {#next}
<CardGroup cols={2}>
<Card title="Cluster records by index partition" icon="circle-nodes" href="/curation/clustering">
Use this function to group and sample records by an existing index's partitions.
</Card>
<Card title="DEDUPE" icon="layer-group" href="/sql/dql/dedupe">
The packaged table function for the deduplication use case, over the same index.
</Card>
</CardGroup>