Skip to content

How to minimize fields queried per Selector methods (and speed up queries)? #417

Answered by ImJohnMDaniel
rsoesemann asked this question in Q&A
Discussion options

You must be logged in to vote

So, I believe the common misconception is that the Selector Pattern is suppose to list “all fields possible”. That would be incorrect.

The Selector Pattern should list “the minimal fields that would be needed by every application in the org”. This ensures the records that are queried have what they need to operate correctly. This is essentially the “Selector’s contract to the org”. (think ‘service contract’ but focused on what fields are guaranteed to be populated).

For certain, be judicious in which fields you add to the base list. Avoid adding fields that are Long Text Area or Rich Text as they take up a huge amount of memory compared to other fields. Definitely look to add common paren…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by rsoesemann
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants