|Oracle Hints in subqueries [message #1832060]
||Mon, 07 September 2020 15:16
| Rafael Garcia
Registered: September 2020
Eclipselink version: 2.6.9
How can i add custom hints in each subquery?
I'm trying to replicate the SQL below but I can't to set hints in the class javax.persistence.criteria.Subquery.
SELECT /*+ NO_PARALLEL */ a.name FROM UserData a WHERE EXISTS(
SELECT /*+ NO_UNNEST NO_PUSH_SUBQ */ 1 FROM UserData a WHERE a.name = "bla bla"
-- Note that I need is to set the NO_UNNEST && NO_PUSH_SUBQ in order to force the SQL optimizer to don't join the result of the subquery to the main body.
I'm trying this formula:
Subquery<UserData> subquery = (from CriteriaQuery<Tuple>).subquery(UserData.class);
((SubQueryImpl<UserData>)subquery).getDatabaseQuery().setHintString("/*+ NO_UNNEST NO_PUSH_SUBQ */");
Could you help me in that point? I don't know if there is any official way to accomplish this goal, or if i need to set it as a literal in the subquery' select...
[Updated on: Mon, 07 September 2020 15:59]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02856 seconds