In Salesforce, the foundation of reporting is the retrieval of an organization's data. If your data is not retrieved efficiently, your reports can be incredibly slow and might time out, which will frustrate your users. Join us to learn the techniques every expert architect should know in order to build reports that fly--and to ensure that your data is at your users fingertips. We'll spend the vast majority of our time covering specific performance-related techniques, such as using reporting governance, as well as what you need to know about the Force.com query optimizer to write reports that are both fast and selective. Note that this session assumes you already understand the basic principles behind building queries and reports.
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
The Need for Speed: Building Reports That Fly
1. Building Reports That Fly
Sean Regan, salesforce.com, @SFDCSRegan
John Tan, salesforce.com, @johntansfdc
Irena Miziolek, NTT Centerstance
Jeannette Liu-Deza, NTT Centerstance
2. Safe Harbor
Safe harbor statement under the Private Securities Litigation Reform Act of 1995:
This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties
materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results
expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be
deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other
financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any
statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services.
The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new
functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our
operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any
litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our
relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our
service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to
larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is
included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent
fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor
Information section of our Web site.
Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently
available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions
based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these
forward-looking statements.
30. Push Data To Users: Force.com Streaming API
Workflow Email Alerts
Chatter Feeds
Scheduled Reports
Visualforce Pages
31. Key Takeaways
✓ Governance ensures efficiency & accuracy
✓ Know your object model
✓ Push data to users to drive workflow
✓ Architect your sharing model based on business requirements
39. Fields That Often Make Good Filters
▪ Date fields
▪ Picklists
▪ Fields with wide and even distribution of values
40. Non-Deterministic Formula Fields Aren’t Good Filters
Can’t index
For example:
▪ References related object
▪ CASE(MyUser__r.UserType__c,1,”Gold”,”Silver”)
▪ Create separate field and use trigger to populate
Force.com SOQL Best Practices: Nulls and Formula Fields
43. Avoid Filters With A Leading % Wildcard
CONTAINS ‘%searchstring%’
✖ CONTAINS (“district”) – equivalent to LIKE ‘%district%’
✔ STARTS WITH (“district”) – equivalent to LIKE ‘district%’
45. Standard Index Selectivity Threshold
A standard index is selective when it returns:
▪ < 30% of the first 1 million records
▪ < 15% of returned records after the first 1 million records
▪ No more than 1 million total records
47. Standard Index Selectivity Threshold
For 750,000 Account records
▪ < 30% of the first 1 million records
▪ 750,000 x .30 = 225,000
48. Standard Index Selectivity Threshold
For 3,500,000 Account records
▪ < 30% of the first 1 million records
▪ < 15% of returned records after the first 1 million records
▪ (1,000,000 x .30) + (2,500,000 x .15) = 675,000
49. Standard Index Selectivity Threshold
Over 5,600,000 Account records
▪ No more than 1 million records
▪ 1,000,000
50. Custom Index Selectivity Threshold
A custom index is selective when it returns:
▪ < 10% of the first million records
▪ < 5% of returned records after the first million records
▪ No more than 333,333 records
56. Skinny Table
▪ Single Object. No cross-object joins
▪ Maximum of 100 fields
▪ Not aggregate/summary data. 1:1 recount between source
and skinny
▪ Skinny updated automatically
▪ Minimal joins
▪ salesforce.com will analyze and create
57. Tell me more about skinny tables …
Webinar: Inside the Force.com Query Optimizer
59. Data Archiving
Reduce the # of records the query optimizer needs to consider
▪ Determine strategy during design phase
▪ Move older records into a different object
▪ Soft deletes still count towards record count
60. Data Aggregation
▪ Report on historical data
▪ Save tabular or summary report to a custom object
▪ Use Analytic Snapshots or Batch Apex
▪ Gists:
• Batch Apex Class - https://gist.github.com/johntansfdc/7044473
• Trigger - https://gist.github.com/johntansfdc/7044570
61. Key Takeaways
✓ Reports should contain at least one selective filter
✓ A filter is selective if…
✓ the field is indexed
✓ the filter does not use an inefficient operator
✓ the filter meets the selectivity theshold
✓ Implement data archiving/aggregation strategies
95. We want to hear
from YOU!
Please take a moment to complete our
session survey
Surveys can be found in the “My Agenda”
portion of the Dreamforce app