skip-take

ASP.NET MVC Webgrid Efficient Paging

随声附和 提交于 2019-12-24 10:47:31
问题 I have a ASP.NET MVC 4 project and a SQL View (vvItem). ItemController MVCAppEntities db = new MVCAppEntities(); public ActionResult Index() { var itemqry = db.vvItem.OrderBy(s => s.name); //var pageditems = itemqry.Skip(10).Take(20); // 25 seconds return View(itemqry.ToList()); // 88 seconds } Index.cshtml View @model IEnumerable<MVCApplication1.Models.vvItem> @{ var norows = 20; var grid = new WebGrid(Model, canPage: true, rowsPerPage: norows); grid.Pager(WebGridPagerModes.NextPrevious);

How to use the RecsSkip and RecsMax property of TFDQuery at runtime

為{幸葍}努か 提交于 2019-12-24 07:57:33
问题 I was looking for a skip and take selection in the TFDQuery. The properties I found are .FetchOptions.RecsSkip and .FetchOptions.RecsMax. I use Tokyo 10.2.3 and database Firebird 3 I make the query at runtime and I want to get the start record at 5 and get the 8 next records. I to something like: Result does not skip the fist 5 records var qryTest: TFDQuery; begin qryTest:= TFDQuery.Create(self); qryTest.Connection := self.FDConnection; qryTest.sql.Text:= ' select * from

How to use the RecsSkip and RecsMax property of TFDQuery at runtime

随声附和 提交于 2019-12-24 07:57:01
问题 I was looking for a skip and take selection in the TFDQuery. The properties I found are .FetchOptions.RecsSkip and .FetchOptions.RecsMax. I use Tokyo 10.2.3 and database Firebird 3 I make the query at runtime and I want to get the start record at 5 and get the 8 next records. I to something like: Result does not skip the fist 5 records var qryTest: TFDQuery; begin qryTest:= TFDQuery.Create(self); qryTest.Connection := self.FDConnection; qryTest.sql.Text:= ' select * from

Read huge table with LINQ to SQL: Running out of memory vs slow paging

空扰寡人 提交于 2019-11-30 10:05:41
I have a huge table which I need to read through on a certain order and compute some aggregate statistics. The table already has a clustered index for the correct order so getting the records themselves is pretty fast. I'm trying to use LINQ to SQL to simplify the code that I need to write. The problem is that I don't want to load all the objects into memory, since the DataContext seems to keep them around -- yet trying to page them results in horrible performance problems. Here's the breakdown. Original attempt was this: var logs = (from record in dataContext.someTable where [index is

Read huge table with LINQ to SQL: Running out of memory vs slow paging

感情迁移 提交于 2019-11-29 15:04:02
问题 I have a huge table which I need to read through on a certain order and compute some aggregate statistics. The table already has a clustered index for the correct order so getting the records themselves is pretty fast. I'm trying to use LINQ to SQL to simplify the code that I need to write. The problem is that I don't want to load all the objects into memory, since the DataContext seems to keep them around -- yet trying to page them results in horrible performance problems. Here's the

Performance of Skip (and similar functions, like Take)

旧时模样 提交于 2019-11-27 21:58:21
I just had a look at the source code of the Skip / Take extension methods of the .NET Framework (on the IEnumerable<T> type) and found that the internal implementation is working with the GetEnumerator method: // .NET framework public static IEnumerable<TSource> Skip<TSource>(this IEnumerable<TSource> source, int count) { if (source == null) throw Error.ArgumentNull("source"); return SkipIterator<TSource>(source, count); } static IEnumerable<TSource> SkipIterator<TSource>(IEnumerable<TSource> source, int count) { using (IEnumerator<TSource> e = source.GetEnumerator()) { while (count > 0 && e

Performance of Skip (and similar functions, like Take)

别等时光非礼了梦想. 提交于 2019-11-26 20:51:57
问题 I just had a look at the source code of the Skip / Take extension methods of the .NET Framework (on the IEnumerable<T> type) and found that the internal implementation is working with the GetEnumerator method: // .NET framework public static IEnumerable<TSource> Skip<TSource>(this IEnumerable<TSource> source, int count) { if (source == null) throw Error.ArgumentNull("source"); return SkipIterator<TSource>(source, count); } static IEnumerable<TSource> SkipIterator<TSource>(IEnumerable<TSource>