In CustInvoiceJour table, the allow duplicate No index is (InvoiceId, InvoiceDate, NumberSequenceGroup, RecId)
Can someone please explain to me the benefit of adding RecId to the index?
As RecId alone should be enough to provide uniqueness.
I know that sometimes we add fields to the index in case we have select statements where we filter by those fields alot. But i think if someone has the RecId then there won't be need to to filter on InvoiceId, InvoiceDate, NumberSequenceGroup
And I don't think there are "where" statements looking at RecId
You're right that if you know RecId, you don't need the other fields. But the reason for including RecId may be different. Imagine that you have a query where you filter by InvoiceId and InvoiceDate and return NumberSequenceGroup and RecId. If you have all the field in an index, you don't have to look into the table at all, therefore it's very efficient.
Was this reply helpful?YesNo
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.