Tengo un decentemente grande postgres mesa con un par de millones de filas.
Sin embargo, la tabla podría ser dividida por una columna (type
)
Debemos preferir:
Un índice con dos columnas
create nonclustered index ix_index1 on table1(type, string_urn_id)
o un condicional índice
create nonclustered index ix_index1_alternative on table1(string_urn_id) WHERE type = 'type1'
create nonclustered index ix_index1_alternative2 on table1(string_urn_id) WHERE type = 'type2'
create nonclustered index ix_index1_alternative3 on table1(string_urn_id) WHERE type = 'type3'
....