[JBoss JIRA] (TEIID-3568) Order By and Limit are not getting pushed to the database, when Union and join are used together.
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3568?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-3568.
-----------------------------------
Resolution: Done
Added logic to rule push limit to push an ordered limit through a join.
> Order By and Limit are not getting pushed to the database, when Union and join are used together.
> --------------------------------------------------------------------------------------------------
>
> Key: TEIID-3568
> URL: https://issues.jboss.org/browse/TEIID-3568
> Project: Teiid
> Issue Type: Enhancement
> Components: Query Engine
> Affects Versions: 8.1
> Reporter: Guru Prasad
> Assignee: Steven Hawkins
> Fix For: 8.12
>
> Attachments: ShowPlan.txt
>
>
> Order By and Limit are not getting pushed to the database, when Union and join are used together.
> In this scenario there if the underlying table has millions of records the query never returns with data.
> *Query 1*: Using only Join without union, this works fine.
> SELECT u.evttypecode, u.evtsysid, u.evtutctod, u.evtsystod, u.evtcatcode FROM (
> select evttypecode, evtsysid, evtutctod, evtsystod, evtcatcode from XYZ.Tab1
> ) as u
> LEFT OUTER JOIN XYZ.CATEGORY AS ct ON u.evtcatcode = ct.evtcatcode
> WHERE (u.EVTUTCTOD >= {ts'2015-06-03 19:20:00.8'}) AND (u.EVTUTCTOD <= {ts'2015-06-03 19:20:01.0'}) ORDER BY u.evtsysid LIMIT 8
> PROCESSOR PLAN:
> AccessNode(0) output=[evttypecode AS evttypecode, evtsysid AS evtsysid, evtutctod AS evtutctod, evtsystod AS evtsystod, evtcatcode AS evtcatcode]
> SELECT g_0.EVTTYPECODE AS c_0, g_0.EVTSYSID AS c_1, g_0.EVTUTCTOD AS c_2, g_0.EVTSYSTOD AS c_3, g_0.EVTCATCODE AS c_4 FROM ABC.Tab1 AS g_0 LEFT OUTER JOIN ABC.CATEGORY AS g_1 ON g_0.EVTCATCODE = g_1.EVTCATCODE WHERE (g_0.EVTUTCTOD >= {ts'2015-06-03 19:20:00.8'}) AND (g_0.EVTUTCTOD <= {ts'2015-06-03 19:20:01.0'}) ORDER BY c_1 LIMIT 8
> *Query 2*: Using only Union without any join, this also works fine.
> SELECT u.evttypecode, u.evtsysid, u.evtutctod, u.evtsystod, u.evtcatcode FROM (
> select evttypecode, evtsysid, evtutctod, evtsystod, evtcatcode from XYZ.Tab1
> UNION ALL
> select evttypecode, evtsysid, evtutctod, evtsystod, evtcatcode from XYZ.Tab2
> ) as u
> WHERE (u.EVTUTCTOD >= {ts'2015-06-03 19:20:00.8'}) AND (u.EVTUTCTOD <= {ts'2015-06-03 19:20:01.0'}) ORDER BY u.evtsysid LIMIT 8
> PROCESSOR PLAN:
> AccessNode(0) output=[evttypecode AS evttypecode, evtsysid AS evtsysid, evtutctod AS evtutctod, evtsystod AS evtsystod, evtcatcode AS evtcatcode]
> SELECT g_1.EVTTYPECODE AS c_0, g_1.EVTSYSID AS c_1, g_1.EVTUTCTOD AS c_2, g_1.EVTSYSTOD AS c_3, g_1.EVTCATCODE AS c_4 FROM ABC.Tab1 AS g_1 WHERE (g_1.EVTUTCTOD >= {ts'2015-06-03 19:20:00.8'}) AND (g_1.EVTUTCTOD <= {ts'2015-06-03 19:20:01.0'}) UNION ALL
> SELECT g_0.EVTTYPECODE AS c_0, g_0.EVTSYSID AS c_1, g_0.EVTUTCTOD AS c_2, g_0.EVTSYSTOD AS c_3, g_0.EVTCATCODE AS c_4 FROM ABC.Tab2 AS g_0 WHERE (g_0.EVTUTCTOD >= {ts'2015-06-03 19:20:00.8'}) AND (g_0.EVTUTCTOD <= {ts'2015-06-03 19:20:01.0'}) ORDER BY c_1 LIMIT 8
> *Query 3*: Using both Union and join, this does not push down the order by and limit.
> SELECT u.evttypecode, u.evtsysid, u.evtutctod, u.evtsystod, u.evtcatcode FROM (
> select evttypecode, evtsysid, evtutctod, evtsystod, evtcatcode from XYZ.Tab1
> UNION ALL
> select evttypecode, evtsysid, evtutctod, evtsystod, evtcatcode from XYZ.Tab2
> ) as u
> LEFT OUTER JOIN XYZ.EVTTYPE AS tp ON tp.evttypecode = u.evttypecode
> LEFT OUTER JOIN XYZ.CATEGORY AS ct ON u.evtcatcode = ct.evtcatcode
> WHERE (u.EVTUTCTOD >= {ts'2015-06-03 19:20:00.8'}) AND (u.EVTUTCTOD <= {ts'2015-06-03 19:20:01.0'}) ORDER BY u.evtsysid LIMIT 8
> PROCESSOR PLAN:
> ProjectNode(0) output=[u.evttypecode, u.evtsysid, u.evtutctod, u.evtsystod, u.evtcatcode] [u.evttypecode, u.evtsysid, u.evtutctod, u.evtsystod, u.evtcatcode]
> LimitNode(1) output=[u.evttypecode, u.evtsysid, u.evtutctod, u.evtsystod, u.evtcatcode] limit 8
> SortNode(2) output=[u.evttypecode, u.evtsysid, u.evtutctod, u.evtsystod, u.evtcatcode] [SORT] [u.evtsysid]
> JoinNode(3) [MERGE JOIN (SORT/ALREADY_SORTED)] [LEFT OUTER JOIN] criteria=[u.evtcatcode=evtcatcode] output=[u.evttypecode, u.evtsysid, u.evtutctod, u.evtsystod, u.evtcatcode]
> JoinNode(4) [MERGE JOIN (SORT/ALREADY_SORTED)] [LEFT OUTER JOIN] criteria=[u.evttypecode=evttypecode] output=[u.evtcatcode, u.evttypecode, u.evtsysid, u.evtutctod, u.evtsystod]
> AccessNode(5) output=[u.evttypecode, u.evtcatcode, u.evtsysid, u.evtutctod, u.evtsystod]
> SELECT g_1.EVTTYPECODE AS c_0, g_1.EVTCATCODE AS c_1, g_1.EVTSYSID AS c_2, g_1.EVTUTCTOD AS c_3, g_1.EVTSYSTOD AS c_4 FROM ABC.Tab1 AS g_1 WHERE (g_1.EVTUTCTOD >= {ts'2015-06-03 19:20:00.8'}) AND (g_1.EVTUTCTOD <= {ts'2015-06-03 19:20:01.0'})
> UNION ALL SELECT g_0.EVTTYPECODE AS c_0, g_0.EVTCATCODE AS c_1, g_0.EVTSYSID AS c_2, g_0.EVTUTCTOD AS c_3, g_0.EVTSYSTOD AS c_4 FROM ABC.Tab2 AS g_0 WHERE (g_0.EVTUTCTOD >= {ts'2015-06-03 19:20:00.8'}) AND (g_0.EVTUTCTOD <= {ts'2015-06-03 19:20:01.0'})
> AccessNode(6) output=[evttypecode] SELECT g_0.EVTTYPECODE AS c_0 FROM ABC.EVTTYPE AS g_0 ORDER BY c_0
> AccessNode(7) output=[evtcatcode] SELECT g_0.EVTCATCODE AS c_0 FROM ABC.CATEGORY AS g_0 ORDER BY c_0
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 5 months
[JBoss JIRA] (TEIID-3582) Add the query requestID to all lines for that query in the logs
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3582?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-3582:
---------------------------------------
This should be low priority as there is already the TEIID-2402 which allows for easy correlation down to the session level.
> Add the query requestID to all lines for that query in the logs
> ---------------------------------------------------------------
>
> Key: TEIID-3582
> URL: https://issues.jboss.org/browse/TEIID-3582
> Project: Teiid
> Issue Type: Enhancement
> Components: Server
> Reporter: Van Halbert
> Assignee: Steven Hawkins
>
> Currently when running a query, the logs show the requestId on most of the lines but not all, especially CONNECTOR.
> for example, the following line doesn't have it:
> 14:13:34,071 DEBUG [org.teiid.CONNECTOR] (Worker1_QueryProcessorQueue13) Source-specific command: ....
> That's the problem. When lots of queries are running, user wants to grep through the log for that requestid and get just that one query's stuff.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 5 months
[JBoss JIRA] (TEIID-3583) Need documentation on possible property settings to use
by Van Halbert (JIRA)
Van Halbert created TEIID-3583:
----------------------------------
Summary: Need documentation on possible property settings to use
Key: TEIID-3583
URL: https://issues.jboss.org/browse/TEIID-3583
Project: Teiid
Issue Type: Enhancement
Reporter: Van Halbert
Assignee: Steven Hawkins
In the Administration and Configuration Guide there is some indication on how to perform active heap throttling.
"Memory Management Considerations " there is a reference to parameters like:
max-processing-kb and the max-reserve-kb.
Anyway there is no indication of the indicative values to associate to those parameters to obtain a certain result.
It would be good to get some examples to understand the cause and effect of the changes ( max-reserve-kb and related settings ).
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 5 months
[JBoss JIRA] (TEIID-3582) Add the query requestID to all lines for that query in the logs
by Van Halbert (JIRA)
Van Halbert created TEIID-3582:
----------------------------------
Summary: Add the query requestID to all lines for that query in the logs
Key: TEIID-3582
URL: https://issues.jboss.org/browse/TEIID-3582
Project: Teiid
Issue Type: Enhancement
Components: Server
Reporter: Van Halbert
Assignee: Steven Hawkins
Currently when running a query, the logs show the requestId on most of the lines but not all, especially CONNECTOR.
for example, the following line doesn't have it:
14:13:34,071 DEBUG [org.teiid.CONNECTOR] (Worker1_QueryProcessorQueue13) Source-specific command: ....
That's the problem. When lots of queries are running, user wants to grep through the log for that requestid and get just that one query's stuff.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 5 months
[JBoss JIRA] (TEIID-3581) Add a system function for EDS-DV Server connection
by Van Halbert (JIRA)
Van Halbert created TEIID-3581:
----------------------------------
Summary: Add a system function for EDS-DV Server connection
Key: TEIID-3581
URL: https://issues.jboss.org/browse/TEIID-3581
Project: Teiid
Issue Type: Enhancement
Components: Server
Reporter: Van Halbert
Assignee: Steven Hawkins
A user has a 4 node Cluster and would like to get not only the sessionid, vdb and user but the node of the cluster that the user is connected to
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 5 months
[JBoss JIRA] (TEIID-3580) Hive 0.13.1 JDBC jars makes queries run slow
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3580?page=com.atlassian.jira.plugin... ]
Steven Hawkins reopened TEIID-3580:
-----------------------------------
Added the same comment form TEIID-3579 - I was not able to see this behavior in embedded. Can you confirm that as well? If that's the case, then this isn't so much of a Teiid issue as an AS issue. It should be straight-forward as well to set up a non-Teiid AS web app or other example to test within AS without Teiid.
> Hive 0.13.1 JDBC jars makes queries run slow
> --------------------------------------------
>
> Key: TEIID-3580
> URL: https://issues.jboss.org/browse/TEIID-3580
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 8.7.3
> Reporter: Debbie Steigner
> Assignee: Steven Hawkins
>
> When using the JDBC jars for Hive 0.13.1 running on HDP 2.1, queries executed against table 'default.sample_07' takes approximately 20-30 seconds to return.
> The Hive JDBC jars for version 0.13.1 can be found here :
> https://github.com/vchintal/hive-jdbc-jars-archive
> Alternatively a ready-to-go modules can be downloaded from here for testing:
> https://drive.google.com/file/d/0BxJhoZ1V34QHSmgzTlBRVktZaGM/
> Use the following driver snippet when using the above mentioned module:
> <driver name="hive" module="org.apache.hadoop.hive:0.13.1">
> <driver-class>org.apache.hive.jdbc.HiveDriver</driver-class>
> </driver>
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 5 months