#20162·jOOQ

Add Settings.renderImplicitJoinPathElimination to allow for opting out of JOIN elimination with path joins

Author: lukasederCreated Aug 31, 2026Updated Aug 31, 2026
LabelsT: EnhancementC: FunctionalityP: MediumE: All Editions

jOOQ's path joins support JOIN elimination when it can be proven that some tables are unnecessarily joined, i.e. unnecessarily listed in paths:

This is shown here:

Example:

sql
create table mcve.parent1 (id int not null primary key);
create table mcve.parent2 (id int not null primary key);
create table mcve.child12 (parent1 int not null references mcve.parent1, parent2 int not null references mcve.parent2);
create table mcve.parent3 (id int not null primary key);
create table mcve.child23 (parent2 int not null references mcve.parent2, parent3 int not null references mcve.parent3);

This query lists parent2(), an unnecessary path:

java
    ctx
        .select()
        .from(PARENT1)
        .where(PARENT1.child12().parent2().child23().PARENT3.eq(2))
        .fetch();

It's unnecessary because we can simply jump from child12() to child23(). Sometimes, this elimination is not wanted, e.g. to work around bugs like https://github.com/jOOQ/jOOQ/issues/19570, or for other reasons. In those cases, it might be useful to be able to opt out of this elimination with a new Settings flag.