0

I am using a Silverlight DataGrid with a DomainDataSource and a DataPager and EF 4 When using MSSQL server profiler, I noticed 2 queries which we taking the bulk of the data retrieval time. One query gets the data for the given load size, and another which gets the total page count. The one getting the page count is very slow for large sets of data, much slower than getting the data itself!

So my question is this: Is it possible to suppress this query? I know the datapager needs to know how many pages there are but I think I can work around that if I have to

Thanks

zXynK
  • 1,101
  • 16
  • 30
  • Page count retrieval is normally one of the fastest operations. What do your joins look like? – iCollect.it Ltd Jun 26 '12 at 11:12
  • a mess quite frankly. It is getting a huge count(loadsize 40, page count >4000). The query is using a view which i've indexed and optimised to get the data fine – zXynK Jun 26 '12 at 11:16

1 Answers1

0

setting 'IncludeTotalCount' on the query to false worked. I did this in the override method of Load in the database context but iguess it can be done on a specific query.

zXynK
  • 1,101
  • 16
  • 30