Re: Table updated????
Posted in 1996
Joseph Cullipher <joseph@cannonexpress.com> wrote in article
<56q6b9$b08@cssun.mathcs.emory.edu>...
> I am trying to set up an "update statistics" routine to run on a nightly
> basis. Some of my tables get updated every day but others might only
> get updated once a week. I would like to know if there is a way using
> sql to find out which tables have been updated during the day. I am
> using SE 7.10.UC1 and RGL 6.00.UE3.
One thing you can do is check the results of:
select count(*) from table
versus the results of
select nrows from systables where tabname = "table"
If the two differ by say more than 10% - 20%, update the statistics for
that table. This, of course won't tell you if rows were simply updated and
not inserted or deleted, but unless you are commonly changing indexed
fields, this should not matter much. Other, more detailed methods of
tracking when to do update statistics can be accomplished by setting up
some of your own tables which track when the last time statistics were
updated, what indexes were in existence at the time, etc. In this way, the
decision about when to update can be based upon how different the number of
rows is, when the last update statistics was run, when an index is added
and/or dropped, etc.
HTH
--
Irwin Goldstein
Objective Software Systems, Inc.
http://www.objectsoft.com