function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sujithkrishsujithkrish 

timeout during querying against db with huge no. of accounts

 

My query goes like this:

Select a.Name, a.Id From Account a WHERE OwnerId = 'xyz'

 

This query times out when queried against salesfoce database with huge number of accounts (looks like they have millions of records) Can someone provide me with options I have in this scenario?

 

Thanks

 

 

atul_Bharmalatul_Bharmal

Why dont you try this

 

Select a.Name, a.Id From Account a WHERE OwnerId = 'xyz' limit 5000 or 50000

 

will help go through the governer limits of force.com

sujithkrishsujithkrish

Thanks for your reply Atul.

 

Yes. I did try setting limit (limit 1500), but this didnt come into any use.

 

Obviously when the query has few more where clause, it is timing out. Here's another query I have.

 

Select a.Name, a.Id From Account a WHERE OwnerId = 'xyz' AND (Name LIKE 'A%' OR Name LIKE 'Cath%') order by Name asc limit 1500

 

 

I have read in one of the posts where they were mentioning about trying to run as user with 'view_all_data'. I have no clue about this. Can someone throw some light about this?

 

Any help is greatly appreciated.

 

Thanks

atul_Bharmalatul_Bharmal

Hi,

 

Alright it seems to be a security issue then....

 

Follow the steps below to check view all data, may be helpful....

 

1. Check the credentials.

2. Login with those credential on salesforce.

3. Check the profile assigned to the user in salesforce.com

4. in profile check if the user is having view all data access to object from which quering data.

 

Hope this help...

 

Let me know if anything else is required...

 

mark it right if you find it right :)