The following is a multi-part blog series discussing RetrieveMultiple query performance.  RetrieveMultiple is the retrieval of one or more entity instances based on specified criteria.  This type of query will be executed by all users when retrieving CRM data.  When this executes, security needs to be taken into consideration if the query is executed by someone that does not have administrative access, or full read rights to the entity being retrieved.  The additional security checks often will lead to performance issues for the end user trying to retrieve data.

This blog series will be broken up into the following sections:

1.       RetrieveMultiple Intro.

2.       RetrieveMultiple Administrator Query.

3.       EnableRetrieveMultipleOptimization.

4.       RecordCountLimitToSwitchToCteSecuritySql.

5.       Sharing Considerations.

6.       IdsCount* Settings. 

7.       Other Considerations. 




Before getting into these topics, I want to briefly discuss OrgDbOrgSettings.  All settings that are relevant to RetrieveMultiple performance are stored as OrgDbOrgSettings.  The relevant settings will be discussed in detail in the next posts of this series.  To retrieve or modify OrgDbOrgSettings, there are three methods that can be used:

·         Utilize the OrgDbOrgSettings Tool to retrieve or modify the information via Command Prompt.


·         Install the OrgDbOrgSettings Solution to retrieve or modify the information via the UI.


·         Execute the following query to retrieve the data directly from the database if necessary:

    select OrgDbOrgSettings from OrganizationBase

Next post in this blog series: RetrieveMultiple Intro.