Ho un decentemente grande postgres tavolo con un paio di miliardi di righe.
Tuttavia la tabella potrebbe essere scandito da una colonna (type
)
Dovremmo preferire:
Un indice con due colonne
create nonclustered index ix_index1 on table1(type, string_urn_id)
o un condizionale indice
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'
....