Join Sara Morgan for an in-depth discussion in this video Solution: Rewrite query to use indexed field, part of Improving Visualforce Performance.
- So, here's my solution to the challenge.…And I want to start by showing you the original query…that I gave you in the last challenge,…and if we examine the cost of that query,…you'll see that it's pretty high…and we're doing a table scan,…and it's almost three here.…So, right away, I know this is not a very optimizable query.…And the first culprit I can look at…is that not optimizable operator of not equals…that I told you was not a good thing to use.…
So, if I want to look at an alternative for this query,…and I still want to return all open opportunities,…I'll have to look at some other options.…And one of the first options I could look at,…if you notice the StageName and what it's returning,…in certain cases when that opportunity is closed,…that StageName has the word Closed in it.…So, one option I can look at is…WHERE…(NOT StageName…Like Closed)…And do a wildcard character at the end of that,…so I'd be getting everything that's sort of like closed.…
And if I go ahead and do query plan,…notice that my cost has gone down a little bit to 2.688,…
- Reducing and eliminating view states
- Evaluating SOQL for efficiency
- Using Workbench and the Query Plan tool to evaluate queries
- Reducing use of action tags through Visualforce remoting
- Working with the StandardSetController class
- Using static resources
Skill Level Intermediate
1. Getting Started
2. Reducing or Eliminating View State
3. Evaluating Queries for Efficiency
Limiting data returned10m 8s
4. Reducing Use of Action Tags
5. Taking Advantage of StandardSetControllers
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.