× Heads up!

Aqua Data Studio / nhilam

Follow
IDE for Relational Databases
×
samjacinto reported 2020-08-19T17:56:28Z  · tomconrad last modified 2020-08-19T18:14:00Z

Case #00803150 - ADS executing extra queries when running query on Teradata.


code review
Priority Major
Complexity Unknown
Component DB - Teradata
Version Future

Reference Aquaclusters case 230

When I execute a query in the query browser, AquaData Studio sometimes submits up-to 16 extra queries to the database in the format:

SELECT TableKind, TableName FROM DBC.TablesVX WHERE TableKind IN ('T', 'O', 'V') AND DatabaseName = 'ABC' ORDER BY TableKind, TableName

The database name is different depending on the query, but is often an alias for a table in the query and not actually a real database. This is drastically slowing down the query response from the database. Often these queries fail with "java.sql.SQLException: [Teradata Database] [TeraJDBC 16.20.00.12] [Error 3130] [SQLState HY000] Response limit exceeded."

All 16 queries against the DBC.TablesVX view are exactly the same.

Is there a way to prevent these queries or prevent so many of them from executing?

Attached is the SQL log for several queries I've run today and the datastudio.log file. You'll see that sometimes this happens and sometimes it does not.

The queries are firing as I start typing or editing an existing query, potentially before executing the query.


For example, if I have a query:

(Step 1)
select
t1.column
from mydb.mytable t1

I then see a automatic query run on:

SELECT TableKind, TableName FROM DBC.TablesVX WHERE TableKind IN ('T', 'O', 'V') AND DatabaseName = 't1' ORDER BY TableKind, TableName

(Step 2)
If I edit the query

select
t1.column
from mydb.mytable t1
join mydb.myothertable t2

I then see two automatic queries run:

SELECT TableKind, TableName FROM DBC.TablesVX WHERE TableKind IN ('T', 'O', 'V') AND DatabaseName = 't1' ORDER BY TableKind, TableName
SELECT TableKind, TableName FROM DBC.TablesVX WHERE TableKind IN ('T', 'O', 'V') AND DatabaseName = 't2' ORDER BY TableKind, TableName

Neither t1 or t2 are database names, they are aliases. These queries are repeated multiple times to the point where our database configuration starts rejecting them because there are too many open threads.

(Step 3)
If I add to the where clause and type one of the table aliases, then I see a query executed to retrieve the columns available, which is expected.

select
t1.column
from mydb.mytable t1
join mydb.myothertable t2
where t2.


SELECT tbl.Version, tbl.TableKind, tbl.ProtectionType, tbl.JournalFlag, tbl.CreatorName, tbl.ParentCount, tbl.ChildCount, tbl.NamedTblCheckCount, tbl.UnnamedTblCheckExist, tbl.PrimaryKeyIndexId, tbl.RepStatus, tbl.CreateTimeStamp, tbl.LastAlterName, tbl.LastAlterTimeStamp, tbl.RequestTxtOverflow, tbl.AccessCount, tbl.LastAccessTimeStamp, tbl.UtilVersion, tbl.QueueFlag, tbl.CommitOpt, tbl.TransLog, tbl.CheckOpt, tbl.CommentString, clm.ColumnName, clm.SPParameterType, clm.ColumnType, clm.ColumnUDTName, clm.ColumnLength, clm.DefaultValue, clm.Nullable, clm.CommentString, clm.DecimalTotalDigits, clm.DecimalFractionalDigits, clm.ColumnId, clm.UpperCaseFlag, clm.Compressible, clm.CompressValue, clm.ColumnConstraint, clm.CreateTimeStamp, clm.LastAlterTimeStamp, clm.CharType, clm.IdColType, clm.CompressValueList, clm.ColumnFormat, clm.ColumnTitle, j.Journals_DB, j.JournalName , clm.storageFormat AS storageFormat, blockcompression AS blockcompression, blockcompressionAlgorithm AS blockcompressionAlgorithm, blockcompressionlevel AS blockcompressionlevel FROM DBC.TablesVX tbl LEFT JOIN DBC.ColumnsVX clm ON (tbl.DatabaseName = clm.DatabaseName AND tbl.TableName = clm.TableName) LEFT JOIN dbc.journalsVX j ON (tbl.DatabaseName = j.Tables_DB AND tbl.TableName = j.TableName) WHERE tbl.DatabaseName = 'mydb' AND tbl.TableName = 't2' ORDER BY clm.ColumnId

5 attachments

Issue #15807

New
 
 
Completion
No due date
No fixed build
No time estimate

About AquaClusters Privacy Policy Support Version - 19.0.2-4 AquaFold, Inc Copyright © 2007-2017