Avoid usage of Rec.Count() if possible #722
christophstuber
started this conversation in
New Rule
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Count can be one of the most expensive database operations on large tables. I often see examples like this in code:
Checking for no records:
Should be replaced by:
Checking for any records:
Becomes:
Checking for exactly one record:
Refering to https://vjeko.com/2017/03/08/the-if-count-1-conundrum/
Checking for more than one record:
Beta Was this translation helpful? Give feedback.
All reactions