Sobes.tech
Middle+

What is the purpose of a partial index in a database?

sobes.tech AI

Answer from AI

A partial index (filtered index) is used to index a subset of table rows. This allows:

  • Reducing index size: Only relevant records are indexed, saving disk space and memory.
  • Speeding up queries: A smaller index tree is scanned, which is faster for queries that only access the indexed subset.
  • Improving performance of insert, update, and delete operations: A smaller index requires less effort to maintain.

Example usage: indexing only active users or orders with a specific status.