before this change
```sql
SELECT "posts".* FROM "posts" WHERE "posts"."title" = "post91 was updated" LIMIT 1;
SELECT 1 AS one FROM "posts"
WHERE (
"posts"."created_at" < (SELECT "posts"."created_at" FROM "posts" WHERE "posts"."id" = 'dd46c346-5368-4a09-a7a8-0d7d25ec2938') OR
"posts"."created_at" = (SELECT "posts"."created_at" FROM "posts" WHERE "posts"."id" = 'dd46c346-5368-4a09-a7a8-0d7d25ec2938') AND
"posts"."id" < 'dd46c346-5368-4a09-a7a8-0d7d25ec2938'
)
LIMIT 1;
SELECT "posts".* FROM "posts"
WHERE (
"posts"."created_at" < (SELECT "posts"."created_at" FROM "posts" WHERE "posts"."id" = 'dd46c346-5368-4a09-a7a8-0d7d25ec2938') OR
"posts"."created_at" = (SELECT "posts"."created_at" FROM "posts" WHERE "posts"."id" = 'dd46c346-5368-4a09-a7a8-0d7d25ec2938') AND
"posts"."id" < 'dd46c346-5368-4a09-a7a8-0d7d25ec2938'
)
ORDER BY "posts"."updated_at" DESC, "posts"."created_at" DESC, "posts"."id" DESC
LIMIT 20;
```
this change
```sql
SELECT "posts".* FROM "posts" WHERE "posts"."title" = "post91 was updated" LIMIT 1;
SELECT 1 AS one FROM "posts"
WHERE (
"posts"."updated_at" < (SELECT "posts"."updated_at" FROM "posts" WHERE "posts"."id" = '7c9ac4db-7017-4660-9c4a-0486b50032b2') OR
"posts"."updated_at" = (SELECT "posts"."updated_at" FROM "posts" WHERE "posts"."id" = '7c9ac4db-7017-4660-9c4a-0486b50032b2') AND
"posts"."id" < '7c9ac4db-7017-4660-9c4a-0486b50032b2'
)
LIMIT 1;
SELECT "posts".* FROM "posts"
WHERE (
"posts"."updated_at" < (SELECT "posts"."updated_at" FROM "posts" WHERE "posts"."id" = '7c9ac4db-7017-4660-9c4a-0486b50032b2') OR
"posts"."updated_at" = (SELECT "posts"."updated_at" FROM "posts" WHERE "posts"."id" = '7c9ac4db-7017-4660-9c4a-0486b50032b2') AND
"posts"."id" < '7c9ac4db-7017-4660-9c4a-0486b50032b2'
)
ORDER BY "posts"."updated_at" DESC, "posts"."created_at" DESC, "posts"."id" DESC
LIMIT 20;
```
Solve: https://github.com/Uysim/pagy-cursor/issues/38
This will fix the following case
Compare query
before this change
```sql SELECT "posts".* FROM "posts" WHERE "posts"."title" = "post91 was updated" LIMIT 1; SELECT 1 AS one FROM "posts" WHERE ( "posts"."created_at" < (SELECT "posts"."created_at" FROM "posts" WHERE "posts"."id" = 'dd46c346-5368-4a09-a7a8-0d7d25ec2938') OR "posts"."created_at" = (SELECT "posts"."created_at" FROM "posts" WHERE "posts"."id" = 'dd46c346-5368-4a09-a7a8-0d7d25ec2938') AND "posts"."id" < 'dd46c346-5368-4a09-a7a8-0d7d25ec2938' ) LIMIT 1; SELECT "posts".* FROM "posts" WHERE ( "posts"."created_at" < (SELECT "posts"."created_at" FROM "posts" WHERE "posts"."id" = 'dd46c346-5368-4a09-a7a8-0d7d25ec2938') OR "posts"."created_at" = (SELECT "posts"."created_at" FROM "posts" WHERE "posts"."id" = 'dd46c346-5368-4a09-a7a8-0d7d25ec2938') AND "posts"."id" < 'dd46c346-5368-4a09-a7a8-0d7d25ec2938' ) ORDER BY "posts"."updated_at" DESC, "posts"."created_at" DESC, "posts"."id" DESC LIMIT 20; ```this change
```sql SELECT "posts".* FROM "posts" WHERE "posts"."title" = "post91 was updated" LIMIT 1; SELECT 1 AS one FROM "posts" WHERE ( "posts"."updated_at" < (SELECT "posts"."updated_at" FROM "posts" WHERE "posts"."id" = '7c9ac4db-7017-4660-9c4a-0486b50032b2') OR "posts"."updated_at" = (SELECT "posts"."updated_at" FROM "posts" WHERE "posts"."id" = '7c9ac4db-7017-4660-9c4a-0486b50032b2') AND "posts"."id" < '7c9ac4db-7017-4660-9c4a-0486b50032b2' ) LIMIT 1; SELECT "posts".* FROM "posts" WHERE ( "posts"."updated_at" < (SELECT "posts"."updated_at" FROM "posts" WHERE "posts"."id" = '7c9ac4db-7017-4660-9c4a-0486b50032b2') OR "posts"."updated_at" = (SELECT "posts"."updated_at" FROM "posts" WHERE "posts"."id" = '7c9ac4db-7017-4660-9c4a-0486b50032b2') AND "posts"."id" < '7c9ac4db-7017-4660-9c4a-0486b50032b2' ) ORDER BY "posts"."updated_at" DESC, "posts"."created_at" DESC, "posts"."id" DESC LIMIT 20; ```