[Tfug] more RDBMS

Terence Rudkin trudkin at gmail.com
Mon Oct 22 19:16:36 MST 2007


On 10/22/07, Bexley Hall <bexley401 at yahoo.com> wrote:
> Hi,
>
> I *hope* these are simple RDBMS questions (even
> though the simple ones never actually *prove* to
> be so!  :< )
>
> Question primo:
>
> I'm looking for an inexpensive (computationally)
> way to see if a "database", or, specifically, a
> certain *table* has been *changed* since the last
> time I "noticed" it.  I.e. a way of stat(2)'ing
> it that is *portable* (i.e. lives in SQL land).
Some databases have that as a feature that the last update can be an
inexpensive query, even if the database is not.  Some also have in the
data dictionary information of last update to a table.   But you can
roll your own solution with a table LAST_TAB_UPDATE, with two columns
TABLE_NAME, LAST_CHANGE .  Then if updates are all done
programmatically update both tables, else if TRIGGERS are supported
then on update or insert update the table.  The inexpensive read of
the update table can prevent the need of a more expensive refresh.
You asked  for a SQL answer, but a framework like Hibernate handles
this automagically.

>
> Essentially, I need to do an expensive query
> but *only* if the dataset has changed since the
> last time I ran that query.  (presumably, I ran
> it last time *because* the dataset had changed!)
> I.e., I do some client-side caching...
>
> Question secundo:
>
> In a VERY LIGHT DUTY APPLICATION, how foolish is
> it for clients to periodically issue queries of
> the RDBMS like:
>
>   SELECT now;
>
> instead of tracking time "locally", themselves?
> I.e., use the RDBMS as a time reference instead
> of burdening the individual clients (which, in
> this case, are kiosks) with the overhead of a
> "real" time service?
the database should use the same time service as the client.  So an
infrequent sanity check from client to server would be my solution.
>
> Thanks!
> --don
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> _______________________________________________
> Tucson Free Unix Group - tfug at tfug.org
> Subscription Options:
> http://www.tfug.org/mailman/listinfo/tfug_tfug.org
>




More information about the tfug mailing list