17
votes
Accepted
How to get MAX value using SOQL when there are more than 50,000 rows
Take out the MAX from your query:
SELECT Auto_Number__c FROM Opportunity ORDER BY Auto_Number__c DESC LIMIT 1
6
votes
500K record transaction: Trigger vs Scheduled Apex?
Triggers run against batches of (up to) 200 records, no matter if it's 200 records or 20,000,000 records. The API won't allow batches larger than 2,000, and this is typically unusual. Most data loads ...
4
votes
Owner Data Skew Prevention for smaller orgs
The risk of ownership skew has to do with sharing calculations, especially moving users in the role hierarchy. You can read more about it in Ownership Skew. If this isn't a commonly performed ...
4
votes
Accepted
Data skew exists whereby the number of matching rows is very large
You only have one query, so the culprit is pretty clear:
SELECT Id,OppLineItemsCount__c, (SELECT Id FROM Opportunitylineitems)
FROM Opportunity
WHERE StageName IN: mapOCRRequiredStages.keySet()
...
4
votes
Accepted
System.LimitException: Too many query rows: 50001 - How to solve it with a batch?
On the face of it, a Batch on Contract would be appropriate. I would write the batch to iterate the Contracts and have the execute perform the aggregate query and related processing. Your aggregate ...
4
votes
Accepted
Treatment of large data sets (>1M) in standard objects
It doesn't.
Standard objects and Big Objects are separate kinds of database entity. Big Objects are custom objects you can create to store massive amounts of data, while accepting certain limitations ...
3
votes
Accepted
Aggregate Query on 900K records - how to do this?
It seems to me this is very like your previous question, and likely has the same basic answer...
The issue I see in your first batch is that the aggregate query does not limit the query for "maplastY"...
3
votes
Query not selective error is happening only in Trigger context but not in VF,Batch. Is this expected?
There are unique limitations when running large, non-selective queries in a trigger context:
Developers receive an error message when a non-selective query in a trigger executes against an object ...
2
votes
Accepted
Real time synch with external application on insert and update of frequently changing records
You have a classic use case for Change Data Capture here.
Receive near-real-time changes of Salesforce records, and synchronize corresponding records in an external data store. Change Data Capture ...
2
votes
Accepted
Dynamic Queries on Dynamic Objects at Volume
This is a tricky one, because a) it's rather an opinion-based question in a lot of ways and b) there are only so many design/implementation patterns available to you in the Salesforce context. It's ...
2
votes
Accepted
Alternate of Protected Custom Settings In an AppExchange Managed Package for Large Configuration Data
I think I would address this in two parts:
Have a protected Custom Metadata Type record that is set up by the installer for the managed package to contain an encryption/decryption key (and whatever ...
2
votes
Accepted
Working with large data volume
In Salesforce, you can only update 10,000 records in a transaction, and that's via Apex. Otherwise, using the API and other tools, you're limited to just 200 records per transaction. So, at no point ...
2
votes
Accepted
Case Object with 2 Self Lookups to Cases - Considerations
One area to think about (not sure how important) is the Account Case relations. With 1.6m records, I'd be wary of hitting the 10k or less best practice for lookups( and master-details) that have ...
2
votes
Accepted
How to store information on Product stocks with variable number of warehouses
I think you've outlined all the possible solutions to storing data in Salesforce. Because of your requirements which include using standard reporting and automation, you can't consider all the ...
1
vote
How indexes work when the WHERE clause contains AND
In the first link, the part you quoted was talking only about custom indexes. Standard indexes use the rules in the preceding paragraph:
Standard Indexed Fields
Used if the filter matches less than ...
1
vote
Accepted
Custom Indexes of Null Records
In Salesforce, one index is created for each field that meets a certain criteria. Note that we're talking about database table indexes, not search indexes, which are a different topic. We'll only be ...
1
vote
Difference between Salesforce Connect and Heroku Connect
There are 4 orgs.
1 main org
2 sales orgs
1 service org.
They want to centralize data that is created on boths sales and service orgs.
In order to do that, they need to use Heroku Connect as the ...
1
vote
Accepted
Difference between Salesforce Connect and Heroku Connect
The key difference between Heroku Connect and Salesforce Connect is Heroku Connect synchronizes records between a Heroku Database and Salesforce (a copy of the data is kept on both systems). ...
1
vote
Testing bulk clone operation
You cannot test this in a unit test that actually performs DML. The DML rows limit is 10,000 in a single transaction, and even using Test.startTest() and Test.stopTest() to execute your batch class ...
1
vote
Bulk deletion of Case Team Member records, data skew, and performance issues
I have performed couple of bulk delete and Sharing recalculation related activities and here is my suggestions.
Usually, this exercise needs to perform in a full copy sandbox though performance can ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
largedatavolumes × 60apex × 21
soql × 13
batch × 10
governorlimits × 9
trigger × 6
bulk-api × 5
integration × 4
limits × 4
ldv × 4
visualforce × 3
rest-api × 3
bestpractice × 3
heroku × 3
selectivity × 3
managed-package × 2
scheduled-apex × 2
data-loader × 2
appexchange × 2
dynamic-soql × 2
performance × 2
isv × 2
queue × 2
big-object × 2
storage-limit × 2