I have to perform a query with a huge IN clause (about 1000 values). For example, in SQL it would look like
WHERE "entity"."page" IN (1, 2, 3, 4, 5,...)
In Postgres it seems to be a lot faster when you use the VALUES function in the IN clause like this:
WHERE "entity"."page" IN (VALUES (1), (2), (3), (4), (5),...)
But I can't figure out how to create such a query in JOOQ. Is that even possible?
Unfortunately I can't do anything about the data model - it's a legacy application.