This question is related to my issue described here: SharePoint 2010 Performance troubleshooting

On SP 2010: Does anyone knows if there is some performance limitations while using SPListItemVersionCollection?

Scenario: List with 3-4K items with unique item permissions and many versions (~5-60 per item).

When executing:

 foreach (SPListItemVersion version in spItem.Versions){...}

It takes just too long...

This code was used in IHttpModule so maybe this is reason why it takes too long but I am wondering if there is some general issue with SPListItemVersionCollection that I am not aware of.

  • Sorry to break your tumbleweed record, but did you ever find an answer to this? I am experiencing the same problem.
    – CigarDoug
    Aug 5, 2013 at 16:30
  • You can limit the fields you're getting by using the workaround: slavensemper.blogspot.com/2013/12/splistitem-with-too-many.html
    – user21336
    Dec 11, 2013 at 8:41
  • Please provide more than a link as an answer. If the link breaks, your answer will be of very little help! :) Dec 11, 2013 at 9:31

1 Answer 1


Instead of placing the spItem.Versions in foreach statement. out the versions in a variable.

var versions =  spItem.Versions;
foreach(var item in versions) {}

because whenever you call spItem.Versions, SharePoint will make a call to get all the versions.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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