Governor Limits Flashcards

1
Q

What are “Limits”?

A

Maximums that are set for different features on the platform and cannot be exceeded

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are “Allocations”?

A

Can be increased because they are the maximums determined by the edition of Salesforce that a customer has purchased

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are “Limitations”?

A

Non-existent characteristics of features and tools, ex. Limitation of the Schema Builder

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Why use Governor Limits?

A
  • cloud based multi-tenant
    • need to prevent one company from using too much resource
  • helps us write more efficient code

if exceeded we get an exception that rolls back any changes that would’ve been made

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are some limits of SOQL?

A
  • In a single transaction, we can
    • execute at most 100 synchronous SOQL queries
    • execute at most 200 asynchronous SOQL queries
    • execute at most 300 synchronous SOQL subqueries
    • return no more than 50,000 records from all queries collectively
  • We can avoid these limits by
    • using selective queries so that only only the records we want are returned
    • keeping queries out of loops
    • returning lists of records rather than individual records
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are some limits of SOSL?

A

more restrictive than SOQL

  • single transaction can only execute 20 SOSL
  • each SOSL search returns up to 2,000 record

We can avoid these limits by

  • keep out of loop
  • return multiple records not individual
  • use filter clauses for selective search
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are some limits of “DML?

A

Limits

  • 150 DML per transaction
  • 10,000 record per operation

Avoid

  • avoid loop
  • act on list of records not individual
  • achieve this via using DML on collection not loop
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the heap size limit?

A
  • a 6 MB synchronous heap or 12 MB asynchronous heap
    • we can avoid this by using SOQL for loops
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

CPU limit?

A

10 seconds of synchronous

or

60 seconds of asynchronous

10 minutes of execution time for a single transaction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Execution time limit?

A

10 minutes for a single transaction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the difference between the get%() and getLimit%() limit class?

A

get%() - how much of a governed operation we’ve used

getLimit%() - return limit on that governed operation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the difference between the get%() and getLimit%() limit class?

A

get%() - how much of a governed operation we’ve used

getLimit%() - return limit on that governed operation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly