Re: Update statistic question
Posted in 1998
Hallo Susan,
I can only tell you the way I do this. We also have alot of tables on our
system and the programs run in about 3 hrs.
We have written the program so that is runs per dbspace (the program will
be run with a master switch and will then spawn itself for every dbspace in
the database). This enables us to run a couple of programs at the same
time.
As far as update stats goes - we update stats LOW DROP DISTRIBUTIONS first
on the whole database. It is your choice if you want to drop distributions
or not, depending on your strategy.
We then update stats HIGH DISTRIBUTIONS ONLY on all indexes columns and
MEDIUM DISTRIBUTIONS ONLY on all remaining columns (non-indexed). By using
the distributions only clause, it will run quicker. Just make sure that you
do not updates stats on the same column more than once.
You should also update stats HIGH on all join-columns and "equality" (=)
columns, but I do not do this as I do not have enough information on our
applications - on the select statements.
I hope this helps.
Regards
Dirk
Susan Elliott (ISG) <SusanE@fclcis.co.nz> wrote in article
<6hk3ma$gir$1@news.xmission.com>...
>
> Thanks to all of those who have been answering my questions over the
> last few days !!! Its much appreciated !!!
>
> I have a question about the Update statistics script that we do
> here....
>
> #### Beginning of script #####
> set isolation dirty read;
> update statistics medium distributions only;
> update statistics high for table (Table name) (Column Name)> distributions only;
> {We do the update statistics high on 13635 tables, like above}
> update statistics low;> ##### End of script ######
>
> This was set up for me. I have worked out that the high over writes
> the mediums on the tables/ columns specified. It does an update low
> across the whole database.
>
> Does this mean that the lows have over written the highs ???
> Should I change the order of this to low, med and then to the highs ??
> Or to med, low and then the highs ??
>
> My next stumbling block is the above script runs sequentially and
> takes over 2 days to complete. (we don't run it very often now) So
> that we can run this more often..... and maybe we will get better
> performance...
>
> What are my options in breaking up the above script ????
> What do other folk do ???
> Can I just break the highs script up and run several at once ???
> Can split it up into table types... general ledger, accounts payable,
> sales etc and do the low, med and then the high on each table types
> ???
> How many scripts I run at once ??? What is this dependant on ???
> physical cpus ? cpu vps ??
>
> Honestly, any help with this would be much appreciated,
>
> Thank in advance
> Best Regards
> Suze.
>
>
>
>
>