Re: Last time update stats ran
Posted in 1997
We run update statistics from a cron job which calls a sheell that commands the update and displays messages and date time with echo and date commands to a standard output file. which we then e-mail to a couple of our staff. Not only do we know when the jobs ran but how long they took. Good luck -- Con Woodall Colorado St. U.; Veterinary Teach. Hosp.; Ft. Collins CO 80523, USofA; 970-491-1244 FAX 970-491-4100 cwoodall@vth1.vth.colostate.edu "There is no 'maybe' in Boolean algebra." -- On 4 Sep 1997, Bill Glidden wrote: } Chuck Ludwigsen (cludwigsen@harrahs.com) wrote: } : Art S. Kagel wrote: } : > } : > Carl Gruber wrote: } : > > } : > > His everyone! } : > > } : > > Is there an easy way to tell when the last time an "update stats" ran for } : > > a particular table? } : > } : > No. Create a table and have your update statistics job maintain a } : > record there, perhaps one row per database or even per table. } : > } : > Art S. Kagel } } : Beg to differ Art. Look at the contents of sysdistrib and notice the } : column named constructed. That is the date the distribution info was } : generated by update statistics. } } : Therefore, run this query: } } : select distinct tabname, b.constructed, b.mode } : from systables a, sysdistrib b } : where a.tabid=b.tabid } : order by 1 } } Does update statistics always generate distributions? No. So, Art's answer } is correct. You can't tell when statistics were last updated, but you can } tell the last time distributions were created. } }