Hi
I just ran into a join query that broken when I added .useIndex("index) on the table.
create.select().from(TBL_A).join(TBL_B).onKey()
works but when adding useIndex("idx_tbl_a_myidx"):
create.select().from(TBL_A.useIndex("idx_tbl_a_myidx")).join(TBL_B).onKey()
it fails with the following stacktrace:
org.jooq.exception.DataAccessException: No matching Key found between tables ["tbl_a" use index ("idx_tbl_a_myidx")] and ["tbl_b"]
at org.jooq.impl.JoinTable.onKeyException(JoinTable.java:775) ~[jooq-3.16.11.jar:na]
at org.jooq.impl.JoinTable.onKey(JoinTable.java:695) ~[jooq-3.16.11.jar:na]
at org.jooq.impl.JoinTable.onKey(JoinTable.java:151) ~[jooq-3.16.11.jar:na]
at org.jooq.impl.SelectQueryImpl.addJoinOnKey(SelectQueryImpl.java:4388) ~[jooq-3.16.11.jar:na]
at org.jooq.impl.SelectImpl.onKey(SelectImpl.java:2196) ~[jooq-3.16.11.jar:na]
at org.jooq.impl.SelectImpl.onKey(SelectImpl.java:143) ~[jooq-3.16.11.jar:na]
It seems like the HintedTable that is created loses its key information or perhaps it is because the tables is aliased (indirectly by the index hint).
Is this a know limitation or should I create an issue?
This is jooq on 3.16.11.
Best regards Jens