Reputation: 4588
I'm looking for a way to dynamically create CRUD queries using JOOQ.
I have a heavily partitioned table and I'd like to perform batch inserts/updates/deletes directly into the right partition. Reason is significant performance gain in my scenario.
DSL.table()
Is there a way to achieve desired behaviour with JOOQ?
Upvotes: 2
Views: 147
Reputation: 220752
The simplest way I can think of is to use the logical table (e.g. from code generation) and apply table mapping at runtime to translate the table directly to the underlying partition.
E.g. you write:
List<MyTableRecord> records = ...
ctx.batchUpdate(records);
But jOOQ doesn't update the MY_TABLE
table, but the MY_TABLE_1341
partition instead:
UPDATE my_table_1341 SET ...
This only works if you're writing to a single partition at a time.
Upvotes: 1