Help me to improve the query performance

Database
Enthusiast

Help me to improve the query performance

Hi all,

When am trying to run the query, it is taking 20hrs to run the query.

we done the collect stats for all the tables by giving Diagnostic collect stats

help me to improve the query performance.

SEL Col1,Col2,Col3,.... Col200 From

Table18 Left Join

(Table1  Inner Join  Table2

On  Table1=Table2  

Inner Join  Table3  

ON  Table1=Table3  

Inner Join  Table4  

ON  Table1=Table4  

Inner Join  Table5  

ON  Table1=Table5  

Inner Join  Table6  

ON  Table1=Table6  

Inner Join  Table7  

ON  Table1=Table7  

Inner Join  Table8  

ON  Table1=Table8  

Inner Join  Table9  

ON  Table1=Table9  

Inner Join  Table10  

ON  Table1=Table10  

Inner Join  Table11  

ON  Table1=Table11  

Inner Join  Table12  

ON  Table1=Table12  

Inner Join  Table13  

ON  Table1=Table13  

Inner Join  Table14  

ON  Table1=Table14  

Inner Join  Table15  

ON  Table1=Table15  

Inner Join  Table16  

ON  Table1=Table16  

Inner Join  Table17  

ON  Table1=Table17)DT

ON DT.COL=Table18.COL

AND table18.datecol between DT.datecol and Dt.datecol1

Tags (1)
3 REPLIES
Enthusiast

Re: Help me to improve the query performance

provide ur original Query.

you are joining table1field with all other tables which will create product join and its product degradation.

Thanks,

Venkat

Teradata Employee

Re: Help me to improve the query performance

Hi,

the recipe is to use Explain and look for highly expensive steps (estimates).   And see what you can do with them.

And use DBQL after executing the query.  Particularly, the DBQLsteps - to find the long-running step(s).   

Regards,

Vlad.

Enthusiast

Re: Help me to improve the query performance

Without looking at the table DDLs and EXPLAIN plain, I don't think its possible to suggest something. Share the table definition and explain plan to have a look.