Skip to main content
Version: Next

IndexOptions <T, H>

Hierarchy

  • BaseOptions<T, H>
    • IndexOptions

Index

Properties

optionalclustered

clustered?: boolean

Whether the index should be clustered (MariaDB, MSSQL). A clustered index determines the physical order of data in the table. Only one clustered index can exist per table.

optionalinheritedcolumns

columns?: IndexColumnOptions[]

Advanced column options for the index. When specified, allows fine-grained control over each column in the index including sort order, nulls ordering, prefix length, and collation. If both columns and properties are specified, columns takes precedence for index creation.

optionaldisabled

disabled?: boolean

Whether the index is disabled (MSSQL only). A disabled index is not used for query planning and is not maintained on writes. It can be re-enabled later using ALTER INDEX ... REBUILD.

optionalinheritedexpression

expression?: string | (T extends EntityClass<P> ? IndexCallback<P> : IndexCallback<T>)

optionalinheritedfillFactor

fillFactor?: number

Fill factor for the index as a percentage 0-100 (PostgreSQL, MSSQL).

optionalinheritedinclude

include?: T extends EntityClass<P> ? Properties<P, H> : Properties<T, H>

Columns to include in the index but not as part of the key (PostgreSQL, MSSQL). These columns are stored in the leaf level of the index but not used for searching.

optionalinvisible

invisible?: boolean

Whether the index is invisible/hidden from the query optimizer (MySQL 8+, MariaDB 10.6+, MongoDB). An invisible index is still maintained on writes but not used for query planning. Useful for testing the impact of removing an index before actually dropping it.

optionalinheritedname

name?: string

optionalinheritedoptions

options?: Dictionary

optionalinheritedproperties

properties?: T extends EntityClass<P> ? Properties<P, H> : Properties<T, H>

optionaltype

type?: string