lance_table/system_index.rs
1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright The Lance Authors
3
4//! System indices: table-level structure persisted as indices.
5//!
6//! Unlike normal indices, whose internals stay opaque behind
7//! [`crate::format::IndexMetadata::index_details`], the table format genuinely
8//! interprets the contents of these indices (fragment remapping, row
9//! visibility). They therefore live at the table layer.
10//!
11//! The `Index`-trait adapters for these structs live in `lance-index`, which
12//! re-exports the structs defined here.
13
14pub mod frag_reuse;
15pub mod mem_wal;
16
17use crate::format::IndexMetadata;
18use frag_reuse::FRAG_REUSE_INDEX_NAME;
19use mem_wal::MEM_WAL_INDEX_NAME;
20
21/// Whether `index_meta` describes one of the system indices defined in this module.
22pub fn is_system_index(index_meta: &IndexMetadata) -> bool {
23 index_meta.name == FRAG_REUSE_INDEX_NAME || index_meta.name == MEM_WAL_INDEX_NAME
24}