+ Start a Discussion

SOQL Limit of 50000 isn't working

I have these 3 queries in the opening of my first page:

        List<Contact> lstContacts = [select id, MailingStreet, MailingCity, MailingState, MailingPostalCode, FirstName, LastName from contact LIMIT 50000];
        List<Lead> lstLeads = [select id, Street, City, State, PostalCode, FirstName, LastName from lead LIMIT 50000];
        List<Account> lstAccounts = [select id, ShippingStreet, ShippingCity, ShippingState, ShippingPostalCode from account LIMIT 50000];

I  have a user that is getting the following error when they try to open the application: Too many query rows: 50001

How is this possible if I have a limit on each of my queries?
nitin sharmanitin sharma
I think from one transaction you can query 50,000 records and it seems that you are querying more than 50,000
So I can't do 3 queries that each have a limit of 50000 records, it is 50000 is the limit for 1 transaction?  So for 1 trip back to the server, only a total of 50000 records for all queries can be retrieved, is that correct?
salesforce documentation mentions it as total number of records retunred in SOQL Queries.
That means it applies to all the queries fired in one transaction.