You need to sign in to do that
Don't have an account?
Haroon Ahmad
SOQL Query with LIke criteria take too long
We're running into a performance issue that we would appreciate guidance on:
We need to a like query on the Name field in the Account object, something like:
[select name from account where name like '%bendoug%' or name like '%gustavo%' or name like '%Ben%' or name like '%wyeth%']
This query is taking very long time to process.
The business requirement is matching against the account name.
Has anybody run into this issue, and solved it?
Thanks.
-Haroon
right, so if they are all of the same record type you could add that since it would be a common field amoung the accounts as well as an indexed one.
All Answers
how many accounts do you have in the system? If you have a lot, is there another field you can throw in there to trim the pool?
We have about 7 million.
Sorry, not sure what you mean by 'Trim the Pool'. Did you mean add a filter, so a smaller set of records get searched?
-Haroon
right, so if they are all of the same record type you could add that since it would be a common field amoung the accounts as well as an indexed one.
But if the result set ends up having to stay pretty large, is there anything we can do in that case?
Add some filter in query like last modydate less than or create date less than specfic date this wil reduce ur query record and query will be fast