We have an application with several Sharepoint document libraries, some of them having millions of documents in them. Due to huge size of lists, the performance is very slow. For eg, sometimes the CAML queries taking about 2-3 minutes to fetch records.

Please advise how can we improve the performance. The documents are going to increase in future.

  • 1
    Introduce a document retention / archiving policy – Arsalan Adam Khatri Apr 8 '18 at 13:33

To improve the performance when running CAML query on the large document libraries, we can do:

  1. Use these parameters “Where, OrderBy, VierFields and RowLimit” in CAML Query to enhance the performance.

  2. Split a long query into smaller parts.

  3. Let a custom timer job run the query.

For more detailed information, refer to the articles below.

Performance enhancement tips while using CAML Query in SharePoint.

Scalability for SharePoint CAML Query.

And you also could re-design the document library with millions of documents according to the article below.

Designing large lists and maximizing list performance (SharePoint Server 2010).

| improve this answer | |

This is the only real option I think: Try to move you searches from a CAML based approach to a search based approach.

Alternatives: You mentioned querieS in your comment so I assume there is more than one DocLib that you query? Are there different DocLibs that hold the information?

If that is not an option you will need to make heavy use of indexes, but based on the size you mentioned you will run into throttling issues most likely. As Amy said CAML does not scale that well.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.