Mám slušne veľké postgres tabuľka s niekoľko miliárd riadkov.
Avšak tabuľky by mohli byť rozdelené do jedného stĺpca (type
)
Mali by sme sa radšej:
Index s dvoma stĺpcami
create nonclustered index ix_index1 on table1(type, string_urn_id)
alebo podmienené index
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'
....