Firstly, run an EXPLAIN, then check the Primary Indexes of the tables and finally check that you have fresh STATS
Then use the details of the Primary Index and the STATS to improve the step by step details of the EXPLAIN
STATS information is held in one of two places, depending on whether its STATS for an index or a column.
I assume you'll want both.
The information is a little difficult to obtain from first principles but if you goolge for "HASHBUCKET SUBSTR" I'm sure you'll find what you're looking for.
I...
Why not use the Teradata Manager to issue an Alert?
Teradata Manager has a suite of alerts that can be defined using the Alert Policy. Options include email or SNMP alerting.
Roger...
Hi Bun,
Try this simple test to help you understand what I mean.
Put the word SHOW before your SQL - e.g.
SHOW SELECT * FROM ...
Hit F5 button (or the green feet). This should show the underlying views / tables in your SQL. Find your "hugh_tbl" and see what the Primary Index is.
Now add...
Hi Bun,
You haven't stated what the Primary Index is.
Also, ">=" will mean that Teradata has to search every row to find matching records.
I suggest you -
Use the PI (let's assume it's Customer_Number & Calendar_Date) and include the reference tables for these.
Change the ">=" to a between -...
Hi,
Make sure you're not loading data in the Primary Index order as this won't use the full power of Teradata.
Also, I suggest you COLLECT STATS on each column / index before loading data into your table -
COLLECT STATS yourtable COLUMN col1;
COLLECT STATS yourtable COLUMN col2;
COLLECT STATS...
Hi bunwong,
do you have a field on "dialed_digits" holding the number of digits?
I'm assuming that this table holds records like 1, 12, 123, etc?
Then if you have a column (e.g. highest_match) to hold 1 for 1, 2 for 12, 3 for 123, etc you should be able to use somthing like this
select...
Hi bcdixit,
You could have written it simpler like this -
select
'select columnname, columntype from dbc.Columns where tablename = ''' ||trim(TableName)|| ''' and databasename = ''BI_STG'' and columntype <> ''TS'';' AS a
from dbc.tables
where DatabaseName = 'BI_STG' ;
Roger...
Hi,
I remember of problem like this many years ago with an old version of the ODBC driver... check that you using the latest version.
Also, you don't mention the application that generates the SQL... it could be this that's at fault.
For Example, a poorly coded Busines Objects universe could...
Hi,
Assuming you got the latest version of Teradata Manager... It's possible to cature this data from "Session Information" by using the "Log to File" option.
This will save details about jobs currently running throughout the day depending on the refresh settings on Session Information.
Then...
Hi jpquinn,
I guess after so long that you've given up waiting for a reply... but in SQL Assistant 6.2 (aka QueryMan) it is now possible to get a Business Objects like prompt.
Like this -
select * from dbc.tables where databasename = '?Database';
And when the SQL is run, a prompt will appear...
Hi Sheila,
Can you see the SQL icon?
If you can, then this will give you access to the code used to get the data... You may need to open the report under the full client version of BO to see this.
Otherwsise, talk to you BO supervisor.
Roger...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.