I haven't work on something like this before but what are the performance implication whether using SOQL or SOSL 500 fields+ (fields will be added dynamically as the application grows) and having 800K rows in a custom object?

I know this seems crazy why would you have 500+ fields in a object but this is a exception case.

  • i'm mostly looking for the area of searching mainly like when you searching 500+ fields using SOSL with all fields how it will impact the performance
    – Nick
    Dec 2, 2016 at 22:08

1 Answer 1


The only real penalty for having tons of fields is that after saving a record with a large number of searchable fields, you may not be able to search on it for a longer period of time (because there's more fields to process). However, salesforce.com uses a very efficient search engine. It really doesn't matter if you have 10 fields to search or a thousand. The system uses an efficient Lucene search engine, and is capable of returning results usually in a fraction of a second, even with many hundreds of millions of rows in a table. Part of this efficiency is how records are indexed, as well as the maximum number of records that a SOSL call can return; it aborts early as soon as it reaches the limit, rather than continuing through all records. Keep in mind that the "ALL FIELDS" operator only searches indexed fields, not literally every field on the object.

  • can you please explain me what do you mean by that it aborts early as soon as it reaches the limit, rather than continuing through all records what limit are we talking about here?
    – Nick
    Dec 6, 2016 at 22:20
  • @NickKahn On the SOQL and SOSL Limits page, you'll see there's a maximum of 2,000 rows per search. This prevents the system from returning too many records, which boosts performance on searches that would otherwise return many results.
    – sfdcfox
    Dec 6, 2016 at 22:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .