Tag Archives: SOQL

Force.com SOQL Best Practice: Sort Optimization

Force.com SOQL Best Practice: Sort Optimization

Do you have a SOQL query or a report that takes a long time to complete because you are querying data from an object that has tens of millions of rows, yet your business requirements won’t allow you to add a selective filter? Read on to learn more about sort optimization, a simple technique that many developers and architects overlook when applying SOQL performance tuning best practices. Continue reading

Collecting Selectivity Statistics for Force.com Queries

Collecting Force.com selectivity statistics

Building efficient SOQL queries, reports, and list views depends on selectivity and indexes, especially when your objects have some serious record counts. Previous resources teach you how the Force.com query optimizer makes decisions, including information about selectivity thresholds for filter conditions. But how can you put this knowledge into practice? This post gives you some simple, practical steps for gauging the selectivity of your filter conditions–before you actually use those conditions in your queries. Continue reading

Maximizing the Performance of Force.com SOQL, Reports, and List Views

If you have sales representatives closing opportunities, support representatives working through a list of cases, or even managers running reports, you’ll want to optimize query performance in your Force.com applications. In saleforce.com’s multitenant environment, the Force.com query optimizer does its own kind of optimization, generating the most efficient SQL from your SOQL, reports, and list views. This blog post explains the filter conditions and the Force.com query optimizer thresholds that determine the selectivity of your queries and affect your overall query performance. Continue reading

Dealing with Exception Filters in Force.com

Dealing with Exception Filters in Force.com

Do you use a long list of filters in your reports or SOQL statements to exclude “noisy” data from your query results? Do you wonder why your requests take so long to run, even when they return only a few hundred rows? You might be able to overcome your performance issue with indexed formula fields, which this blog post explains in detail. Continue reading

Force.com Performance Profiling Using the Developer Console

Force.com Performance Profiling Using the Developer Console

If you’ve built an application on the Force.com platform, you want to deliver a great experience to your users. But how can you tell if your applications are performing well and will continue to perform well? Using the Developer Console, you can use “performance profiling” to identify and fix performance hotspots, and ensure that your applications are both fast and scalable. Continue reading

Force.com SOQL Best Practices: Nulls and Formula Fields

Force.com SOQL Best Practices: Nulls and Formula Fields

Best practices for building Salesforce SOQL queries on large data volumes (LDV) included avoiding filtering on fields with nulls, and formula fields. If you’re implementing new queries—or want to clean up some of the workarounds you implemented prior to the Winter ’13 release—consider these updates related to filtering on nulls and formula fields. Continue reading

Using SOQL to Determine Your Force.com User’s Permissions

Permission sets make salesforce.com admin’s lives easier by assigning permissions to users with more granularity than what a profile already provides. Using SOQL enables admins to view those permission assignments across their user’s profile and permission sets. Continue reading

Bulk API Queries

The Spring '11 release introduced bulk queries as a pilot* feature of the Force.com Bulk API 21.0. With this feature, you can submit SOQL queries to Salesforce, run them asynchronously, and then download all your results once the query is completed. This is a huge win for any developers working with long-running queries or queries with large result sets. You no longer have to leave a connection open while the query is being executed or call queryMore() a zillion times to retrieve the full result set! You can even monitor the progress of the query in Salesforce and download the… Continue reading