Birkaç milyar satır içeren terbiyeli büyük bir postgres tablom var.
Ancak tablo bir sütunla bölümlenebilir (type
)
Tercih etmeli miyiz:
İki sütunlu bir dizin
create nonclustered index ix_index1 on table1(type, string_urn_id)
veya koşullu dizin
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'
....