I am creating indexes for some columns that will be used in a query with Where()
. The intention is to make the search faster. Until then I was creating like this:
Property(x => x.Documento)
.HasColumnAnnotation(IndexAnnotation.AnnotationName,
new IndexAnnotation(new IndexAttribute("ix_documento", 1) { IsUnique = false }));
Property(x => x.Vencimento)
.HasColumnAnnotation(IndexAnnotation.AnnotationName,
new IndexAnnotation(new IndexAttribute("ix_vencimento", 2) { IsUnique = false }));
But I noticed that the class IndexAttribute
has a constructor that only accepts the index name.
The description of the order
parameter is:
order: A number which will be used to determine column ordering for multi-column indexes.
It would look something like this:
A number that will be used to determine column ordering for multi-column indices
I do not understand this, and if in my case it makes any difference or not.