DoStats ignoring stored procedures?
Posted in 2007
Topics: Stored Procedures & SPL
Hello, is there a flag within dostats to not have it update statistics on the stored procedures or is the -x @stored_procedure/path the only method? Thank you, Sean
Not currently as an explicit option. -- My thinking is that updating stats on the tables is likely to invalidate the stored query plans for any procedures that access those tables, and recompiling procedures is relatively cheap, so dostats always does the procedure/function recompilation. However, if you run dostats for a specific list of tables with the -t, -i, or -x options it will skip the procedures/functions unless you include the -p flag. So, if you want to do all tables but no procs just do: dostats -d mydatabase -t '*' An explicit skip procedures option could easily be added. I'll put it on my to-do list and give it some thought. Art ----- Original Message ----- From: Sean McInerney <ids@iiug.org> At: 4/09 19:11:06 Hello, is there a flag within dostats to not have it update statistics on the stored procedures or is the -x @stored_procedure/path the only method? Thank you, Sean ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.
Thank you for replying. A module within our application (unsure which of
course and maybe more then one) is using committed read. The error the
application catches is a cannot read system catalog (sysprocplan). We have
dostats set up within a cron to run every night based on a certain criteria
and will run a full update on a separate cron once a month including the
stored procedures. Having an exclusion flag for stored procedures would be
nice but the statement below also works. I am thinking your suggestion may be
more efficient with the needed parameters below. Thank you for your time. -SM
dostats -h $SVR -d db_name -a -A7 -b -B15 -Q 50 -f - | grep -v PROCEDURE >
stats.sql
dbaccess < stats.sql >> $ERRORFILE 2>&1
Yes, you should be able to replace that with:
dostats -h $SVR -d db_name -t '*' -a -A7 -b -B15 -Q 50
I also have in my todo list an option when using -a/-A and/or -b/-B to only
update procedures that reference the selected tables, but I haven't worked out
the logic yet.
Art S. Kagel
----- Original Message -----
From: Sean McInerney <ids@iiug.org>
At: 4/11 19:21:44
Thank you for replying. A module within our application (unsure which of
course and maybe more then one) is using committed read. The error the
application catches is a 'cannot read system catalog (sysprocplan).' We have
dostats set up within a cron to run every night based on a certain criteria
and will run a full update on a separate cron once a month including the
stored procedures. Having an exclusion flag for stored procedures would be
nice but the statement below also works. I am thinking your suggestion may be
more efficient with the needed parameters below. Thank you for your time. -SM
dostats -h $SVR -d db_name -a -A7 -b -B15 -Q 50 -f - | grep -v PROCEDURE >
stats.sql
dbaccess < stats.sql >> $ERRORFILE 2>&1
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.