Skip to content

feature: let the listelement index apply the fragment reuse index on stable row ID tables #11010

Open

Description

@sarwarbhuiyan

Summary

The experimental listelement scalar index (#10949, #10950) doesn't apply the fragment reuse index. On a table with stable row IDs, every index must apply it. So while a listelement index exists on such a table:

  • compact_files with defer_index_remap is refused: "a ListElement index, which does not apply the fragment reuse index";
  • committing a version that carries both a fragment reuse index and a listelement index fails.

All other built-in scalar indexes except JSON support this. Fragment reuse on stable-row-ID tables is still debug-only (frag_reuse_with_stable_row_ids_enabled()), so released builds aren't affected yet. It needs to land before that becomes the default.

Proposal

listelement stores its entries in a BTree, its target index, which already supports batch row-ID remapping. The plugin can:

  • return true from supports_batch_row_id_remapping;
  • implement load_index_with_remapping by loading its target through the BTree plugin and wrapping the result;
  • handle the cache and rebind paths as BTree does.

Tests: on a stable-row-ID table compacted with defer_index_remap, indexed results match a scan, including NOT and NULL rows. The incompatibility check no longer lists the index.

Spec: add a section on stable row IDs and the fragment reuse index to docs/src/format/index/scalar/list_element.md.

Related: #10900, design discussion #10948.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions