[
https://issues.jboss.org/browse/TEIID-2381?page=com.atlassian.jira.plugin...
]
Steven Hawkins resolved TEIID-2381.
-----------------------------------
Fix Version/s: 8.5
(was: 8.4.1)
Resolution: Partially Completed
Checked into 8.5 since this is a sizable change and may have follow-on changes. Can be
pulled into 8.4.1 if needed.
The change allows for the source hint to appear in any query (with, subquery, etc.), not
just a user level query. And any usage of a source hint in a view will be preserved and a
list of all applicable hints will be sent to the ExecutionContext (getHints and
getGeneralHints). The getHint and getGeneralHint methods still exist and will return a
space concatenated string of the applicable hints.
No attempt was made in the source hint of either directing if the top level hint should
effectively override lower hints nor to add a general global syntax for hint application.
As such this still remains a somewhat crude mechanism in situations involving multiple
source queries to the same source.
There is also a behavior change here in that the source hint will no longer be applicable
to procedure plans and non-merged subqueries (that is any scalar/exists/in that is not
rewriten as a join). With clause items, inline, and the those queries that are
transitively exposed by view access are all considered affected by the source hint and
will accumulate in a single hint. For example:
WITH x as (SELECT /*+ sh:'x' */ e1 from pm1.g2) SELECT /*+ sh:'foo'
bar:'leading' */ g1.e1 from pm1.g1, x where g1.e1 = x.e1 order by g1.e1 limit 1
If it is pushed as a single query will then the pushdown would effectively be:
WITH x as (SELECT e1 from pm1.g2) SELECT /*+ sh:'foo x' bar:'leading' */
g1.e1 from pm1.g1, x where g1.e1 = x.e1 order by g1.e1 limit 1
Note the combination of the general hints in the main select (which is considered the root
query). It may alternatively be desirable to keep the source hint in the nearest query
and altering the translator sql objects rather than squashing to a single hint on the
ExecutionContext - however with non-preserved views we are forced to merge the hint upward
and we just assuming that WITH should be treated the same way.
If pushed as two queries, we have:
SELECT /*+ sh:'x' */ e1 from pm1.g2
and
SELECT /*+ sh:'foo' bar:'leading' */ g1.e1 from pm1.g1
At some point OPTION MAKE [NOT] DEP, NO CACHE, and the source hint mechanism need to be
rationalized (see also TEIID-2263) and have the specification syntax expanded so that the
user can be more exacting as to where the hint is applicable.
Expanded source hint support
----------------------------
Key: TEIID-2381
URL:
https://issues.jboss.org/browse/TEIID-2381
Project: Teiid
Issue Type: Enhancement
Components: Query Engine
Reporter: Steven Hawkins
Assignee: Steven Hawkins
Fix For: 8.5
Attachments: HintsExecutionFactory.java, RandomExecutionFactory.java,
RandomNumberStoredProcedureExecution.java, SysviewHintsExecutionTest.java
We currently look at the source hint in only the root user query (not in subqueries nor
the with clause) and only consider it in a very narrow set of circumstances when it's
used in a view.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira