SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am creating a custom web part which is supposed to return results from an External Content Type(ECT) List which contains almost 40,000 records. There are multiple ways the items can be searched and all of that works fine except it is very slow.

The search is performed by using a specific SPQuery on the ECT List but it seems to take a consistent 20 seconds per query, even when returning just a few results.

Upon further investigation(through SQL Profiler) it seems as if the entire list is being queried each time then sifted through with SPQuery even with specific CAML queries. Is there any way to get around returning the entire list, perhaps accessing filters defined in the ECT list when it is created?

P.S. using SharePoint 2010, SharePoint Design 2010, Visual Studio 2010, C#, in a Visual Web Part

Thanks in advance for any help!

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.