Skip to content

sql: asynchronous [CREATE|DROP] INDEX #2036

@petermattis

Description

@petermattis

See #2035. Adding an index will be a multi-step process:

  • Adding the index to the TableDescriptor but marking it as write-only.
  • Waiting for the TableDescriptor change to propagate to all of the nodes.
  • Backfilling the index with some sort of mapreduce over the table.
  • Marking the index as read-write in the TableDescriptor.

Note that the backfilling of a unique index might detect a duplicate key violation requiring the whole process to be rolled back.

Dropping an index will involve:

  • Marking the index as deleting in the TableDescriptor.
  • Waiting for the TableDescriptor change to propagate to all of the nodes.
  • Deleting the index keys using a DelRange operation.
  • Removing the index from the TableDescriptor.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions