Questions tagged [keyset-pagination]

Use for questions about the Keyset pagination technique

Keyset pagination refers to a technique of serving paged results from a database where the next page of data is selected based on seeking the next N rows ordered by a key starting after the last key value from the previous page.

11 questions
21
votes
3 answers

Is there any better option to apply pagination without applying OFFSET in SQL Server?

I want to apply pagination on a table with huge data. All I want to know a better option than using OFFSET in SQL Server. Here is my simple query: SELECT * FROM TableName ORDER BY Id DESC OFFSET 30000000 ROWS FETCH NEXT 20 ROWS ONLY
7
votes
2 answers

Generic SQL predicate to use for keyset pagination on multiple fields

A common solution to high performance pagination is to use an indexed field, starting each new "page" from the last value of the prior page. For example, with a dataset like this (assuming Category and ID are the primary key): Category | ID |…
eric
  • 511
  • 1
  • 4
  • 15
4
votes
1 answer

Keyset Pagination - Filter By Search Term across Multiple Columns

I'm trying to move away from OFFSET/FETCH pagination to Keyset Pagination (also known as Seek Method). Since I'm just started, there are many questions I have in my mind but this is one of many where I try to get the pagination right along with…
Ammar Khan
  • 346
  • 1
  • 9
  • 27
2
votes
1 answer

Couchbase sorting records with Keyset pagination - missing records

We have couchbase DB running in production with ~4,300,000 documents in a bucket We are trying to retrieve records in paginated way. Currently we are using offset based pagination Eg. To retrieve first 20 records we are using below query, and we are…
1
vote
1 answer

Keyset pagination in Ef core 7

i have been reading this https://learn.microsoft.com/th-th/ef/core/querying/pagination from EFCore team tried to implement it. The problem i am facing with is the example shown here is using a primary key of type INT. in my entity class given below…
1
vote
2 answers

Filtering jsonb properties with `where` clause

Can't get working where statement in sql query. Table structure: create table some_table ( value jsonb not null ); Some test data: INSERT INTO some_table (value) VALUES ('{"id": "480e68b1-f23b-4f5a-9dff-2bd91b4153a5", "appointmentDate":…
Woland
  • 623
  • 2
  • 13
  • 31
0
votes
0 answers

Keyset Pagination for Nvarchar(max) column in sql server

Is it possible to do a key set pagination for nvarchar(max) column in sql server I understand that its possible for int, dates as we can check < value or > value Suppose I have a table Someid Name 1 Abc 2 Cde Currently its written…
0
votes
1 answer

OFFSET ... FETCH is slow on high paging value

This is my scenario: CREATE TABLE [dbo].[tblSMSSendQueueMain]( [ID] [int] IDENTITY(1,1) NOT NULL, [SendMethod] [int] NOT NULL CONSTRAINT [PK_tblSMSSendQueueLog] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF,…
0
votes
2 answers

Optimize SQL query with pagination

I have a query running against a SQL Server database that is taking over 10 seconds to execute. The table being queried has over 14 million rows. I want to display the Text column from a Notes table by a given ServiceUserId in date order. There…
0
votes
1 answer

How to seek/keyset pagination on alphabetical data

I have 2 tables resources resource_votes_aggregate which stores the number of likes per resource_id I want to paginate through resources in descending order of their title using seek/keyset pagination Without Pagination, this is what you…
PirateApp
  • 5,433
  • 4
  • 57
  • 90
0
votes
2 answers

How to use keyset pagination?

Suppose I have total 800 eligible rows in database which is ordered by a column requisitionid in descending order. I want to display the records in 80 pages each page having 10 rows. We are using requisitionid as seek predicate. So the predicate …
Subhendu Mahanta
  • 961
  • 1
  • 18
  • 44