Olaf Ziems, I am setting the parameter as follows:
s.createNativeQuery( "alter session set optimizer_index_cost_adj = 20" ).executeUpdate();
Even with the session parameter set, I cannot get the test to fail. I also pasting your RANK() OVER statement and verified the results from the query:
account0_.id |
account0_1_.id |
account0_2_.id |
account0_3_.id |
creditLimit1_1_ |
clazz_org |
clazz |
1 |
1 |
null |
null |
100 |
1 |
1 |
3 |
null |
3 |
null |
null |
2 |
2 |
4 |
null |
null |
4 |
null |
3 |
3 |
If you review this against your last query in your text attachment, you'll notice the last column is (1, 2, 3) instead of (1, 1, 1) as your file indicates. As far as I can tell, this returns the right expected results against 5.2.6.Final even with optimizer_index_cost_adj specified for the current session. |