Update Statistics and lock modes
Posted in 2000
Topics: Server Administration, Transactions, Locking & Isolation
Hello,
I am trying to run update statistics on a table with several indexes (including composite indexes) as recomended by Informix. (ie: High mode for head column and low for (col1,col2,..)). I am running these from a shell script and each statement in the background as stated below. Since Update statistics lock system catalogs, some of my Update statistics statements are failing due to locks.
To prevent failures due to locks, can I do the following ?
echo "set lock mode to wait ; upd stats statement 1..." | dbaccess ...... &
........
echo "set lock mode to wait ; upd stats statement 10..." | dbaccess ...... &
DEADLOCK_TIMEOUT is set to 60 and tables have over 100 million records.
Thanks
Keith Ponnapalli
Verizon
keith.ponnapalli@verizon.com wrote:
>
> Hello,
>
> I am trying to run update statistics on a table with several indexes (including composite indexes) as recomended by Informix. (ie: High mode for head column and low for (col1,col2,..)). I am running these from a shell script and each statement in the background as stated below. Since Update statistics lock system catalogs, some of my Update statistics statements are failing due to locks.
>
> To prevent failures due to locks, can I do the following ?
>
> echo "set lock mode to wait ; upd stats statement 1..." | dbaccess ...... &
> ........
> echo "set lock mode to wait ; upd stats statement 10..." | dbaccess ...... &
You just have to be careful to only run one update on any table at one time.
One way is to pack the multiple commands for each table into a script for
that file with each command running sequentially in the foreground or in a
single dbaccess/sqlcmd session and run each table's script in background in
parallel with the others. Alternatively get my dostats utility and run one
copy for each table in parallel.
> DEADLOCK_TIMEOUT is set to 60 and tables have over 100 million records.
This timeout has nothing to do with your problem.
Art S. Kagel