Questions tagged [skip-take]

21 questions
28
votes
3 answers

Performance of Skip (and similar functions, like Take)

I just had a look at the source code of the Skip/Take extension methods of the .NET Framework (on the IEnumerable type) and found that the internal implementation is working with the GetEnumerator method: // .NET framework public static…
Bidou
  • 7,378
  • 9
  • 47
  • 70
6
votes
1 answer

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

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…
Andrew Mao
  • 35,740
  • 23
  • 143
  • 224
3
votes
2 answers

Does LINQ skip & take have decent performance?

We have a query for about 40 data fields related to customers. The query will often return a large amount of records, say up to 20,000. We only want to use say around the first 500 results. Then, we just want to be able to page through them 10 at…
alchemical
  • 13,559
  • 23
  • 83
  • 110
3
votes
1 answer

Why is LinqToEntities Skip/Take oracle implementation so slow

Context is an Oracle Database, Entity Framework 5, LinqToEntities, Database First. I'm trying to implement pagination over some large tables, my linqToEntities query looks like this : context.MyDbSet .Include("T2") .Include("T3") …
Florian F.
  • 4,700
  • 26
  • 50
3
votes
2 answers

How to check if IQueryable has OrderBy applied before before attempting Skip() and Take()

I am trying to build an extension method that will Paginated a query. But in order to avoid exception: System.NotSupportedException was unhandled by user code Message=The method 'Skip' is only supported for sorted input in LINQ to Entities. The…
zam6ak
  • 7,229
  • 11
  • 46
  • 84
2
votes
0 answers

How can i set skip parameter on button click in Query?

I have a set of records in which i am applying skip and take parameters in Entity Framework . So in query I set take parameters constant which is 10. I want to change skip parameter dynamically on each button click. this is my code. public…
Faizan
  • 542
  • 5
  • 16
2
votes
1 answer

LINQ TO SQL - Skip/Take not working as expected

I've got an IQueryable repository (admittedly this is the first time I've tried this) and I can't seem to get it to pull the correct data using Skip(1).Take(1) Here's the repository Public Function GetActivity() As IQueryable(Of ActivityLog)…
Chase Florell
  • 46,378
  • 57
  • 186
  • 376
2
votes
1 answer

row_number and count very slow in query with dynamic sql and CTE, how to implement skip and take

I have the following scenario: a table with up to 20000 entries and another table with corresponding custom fields. I need to implement a query with a filter opportunity over all colums (including the custom fields) AND skip and take AND I need the…
Friede
  • 21
  • 3
2
votes
1 answer

Take and Skip in SQL Server and EF

I have a ASP.NET MVC 4 application and I'm using EF. I have a table and a SQL view(the view displays rows from this table plus some unimportant data(~ 1000 records)) with ~ 400.000 records. When I display the data in EF it takes 25 seconds …
Misi
  • 748
  • 5
  • 21
  • 46
1
vote
3 answers

Laravel query builder GROUP BY method alongside with SKIP and TAKE methods

I have around 50000 records and I am showing them in Datatable with server side processing. In my query I am applying the groupBy() method with skip() and take() method. I want to be able to apply the limit AFTER groupBy() e.g. If limit is 10 it…
1
vote
1 answer

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

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…
Ravaut123
  • 2,764
  • 31
  • 46
1
vote
2 answers

Specifying columns in MINUS query yields different results from using *

When I am executing SELECT * FROM TABLE_NAME WHERE ROWNUM <= 20 MINUS SELECT * FROM TABLE_NAME WHERE ROWNUM <= 10 I get expected result of SKIP 10 TAKE 10 (ten rows) but if I specify columns explicitly SELECT COL1, COL2, COL3 FROM TABLE_NAME…
Matas Vaitkevicius
  • 58,075
  • 31
  • 238
  • 265
1
vote
1 answer

NHibernate collection eager loading take count

I having some trouble with a Linq NHibernate query. I need to get a batch of vouchers with their details. As I need to iterate them, I wanted to get all the information in a single execution. My query is the following one: return…
Andres
  • 2,729
  • 5
  • 29
  • 60
1
vote
2 answers

How to make Take() and Skip() modular?

I have a struct like this: public struct Response { public string Cmd; } And also in main I'm having this byte array: Decode(StringToByteArray("0100002402433131000000000000000311")); And then I have a decode function inside this function I…
1
vote
4 answers

ASP.NET MVC Webgrid Efficient Paging

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 =…
Misi
  • 748
  • 5
  • 21
  • 46
1
2