![]() |
|
![]() |
![]() |
Archives of the TeradataForumMessage Posted: Thu, 04 Dec 2003 @ 13:53:53 GMT
The ingenuity displayed in this thread has been impressive. You could also use a Perl script. Below is an excerpt from such a script which uses "help index" to get the description of all indexes and then collects stats on each one. #--------------------------------------------------------------------- # Collect stats on all indexes of a table. #--------------------------------------------------------------------- sub collect_on_indexes { my ($dt) = shift; #--- Get the index specs @ind = (); $hh = $dbh->prepare("help index $dt"); $hh->open; while (@r = $hh->fetchrow_list) { ($iname, $ispec) = @r[5,2]; if ($iname) { push @ind, $iname; } else { push @ind, "($ispec)"; } } $hh->close; #--- Collect stats on them foreach $i (@ind) { issue_collect("collect statistics on $dt index $i"); } return; }
| ||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
![]() | ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||