Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Collect statistics

Status
Not open for further replies.

sivatcs

Programmer
Nov 24, 2005
3
0
0
US
I am inserting into a table in teradata by selecting from 3 tables , it inserts some 7 lakh records and it is very slow.
If i have to use collect statistics before inserting into the table , can i use collect statistics for the columns or how do i go abt it.

Thanks in advance.
 
Hi sivatcs,
there's no need to collect stats before you insert, because the optimizer has no choice but only one way to do the insert.
But you should collect stats probably after the insert.

7 lakh = 700.000?
How large is your target table?
What's the Primary Index?
Is it partitioned?
Any Secondary Indexes/Permanent Journal/Join Indexes?
How fast is the select without insert?
How slow is "very slow"?

Dieter
 
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 yourtable INDEX (col1, col2);
Etc.

Then after you've loaded your data, do a single non -specific COLLECT STATS to refresh these STATS-

COLLECT STATS yourtable;

While doing it this way won't improve the performance of your dataload, it will simplify and speed up the STATS collection a little.

Roger...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top