0 - 11 of 11 tags for query tuning

Hi All,
We have a big table/view with a lot of data 133184k rows and we have  a smaller calender table which has 3k data ,Now when we join them we get all amp duplication issue and get 32k amp cpu time.


I am planning to write an SP that will simply feed in the SQL of a query example someone is running a SQL something like:


 SELECT * FROM dbc.Columns   where DatabaseName ='bla bla';

I need to see all the objects that are involved with this and I am using a SHOW in front of the SQL:


Here's a clever way to force the query optimizer to follow the same *stable* plan for a query regardless of the data set it runs against.  Useful when the data set cardinalities and row count profiles are well understood.  Also useful when ID numbers increase and the query optimizer would have to extrapolate past the right-most interval.

Everyone is taught how to collect statistics in order to make Teradata queries run well but what if you've collected all the statistics that you can and you STILL have bad performance?

Hi, can any one help me giving the code to this query?
I have a Customer table which have duplicate rows. In that table
I. I want only unique rows.
2. I want only Duplicate rows ( if in Table unique rows exist, i don't want them to display)
Thank you

Hi All,
We have a requirement to apply optimization to the exting Bteq Scripts.
What are all possible scope of optimization in a Bteq ?
Is there any best practices document or coding standard guidelines in Teradata Official documentations ?

Hello fellow Teradata-ers,

Hi All
I have two tables like below with sample data:
   ID_COL            |     REF_COL
    123                  |     Desc_123
    100                  |     200_payout

Hi All,
I have scenario like below:

Requirement - Need to select ID values those are present ( hidden)  in DESCR column. But no joining condition in both the tables.
Query I have used -

PFB the table(work_table) created and the data in it:

p_cust p_r_cust p_date
1 2 07/07/2011
2 3 07/09/2011
3 4 07/11/2011

update a
from work_table a ,work_table b
set p_r_cust = b.p_r_cust
where b.p_date >= a.p_date
and b.p_cust = a.p_r_cust
and b.p_r_cust <> a. p_r_cust;

Result table after the first run of the above mentioned query:

p_cust p_r_cust p_date
1 3 07/07/2011
2 4 07/09/2011
3 4 07/11/2011

Result table after the second run of the above mentioned query: