dotConnect for Salesforce Documentation
In This Topic
    Select Statement Execution
    In This Topic

    dotConnect for Salesforce offers client-side cache in the embedded database for optimizing performance of data retrieving. You may define which Salesforce.com or Database.com objects (tables) to cache and the cache parameters. If caching is enabled for a table, this table data will be stored in the cache when retrieved from Salesforce.com or Database.com. To learn more on managing cache, read the Working with Cache section.

    The data can be selected with a SELECT statement, that is SQL-92 standard compliant. SELECT statements are executed in the following way:

    1. A SELECT statement is parsed and the list of the tables that are queried is determined.
    2. These tables are searched in the cache. If cache contains at least one table from the list, other tables from the list are queried, their data is cached in temporary cache, and then the query is executed locally.
    3. If there is no table from the list in cache, dotConnect for Salesforce checks if this SELECT statement can be translated to SOQL.
    4. If this statement can be translated to SOQL, it is translated and executed remotely.
    5. If the statement cannot be translated to SOQL, dotConnect for Salesforce retrieves all the data from the queried tables, caches it in the temporary cache, and executes this query locally.
    Selecting data flow chart

    The local query execution usually takes longer and uses more resources if the data is not cached already, so to optimize application performance it is better to use queries that can be translated to SOQL. To learn what queries can be translated to SOQL, read the SQL Translation topic.