List:General Discussion« Previous MessageNext Message »
From:Egor Egorov Date:June 11 2004 12:25pm
Subject:Re: Last Modified
View as plain text  
"Martijn Tonies" <m.tonies@stripped> wrote:

>> > > If your table contains a timestamp field, it will update each time the
>> row
>> > > is altered.  Otherwise I don't think it's possible.
>> >
>> > That's on a per ROW basis, not TABLE basis.
>>
>> But if it is on every row, you can MAX() it to get the latest row update,
>> which is the latest table update.
> 
> 
> How fast would this be on a largish table?

Build an index on this column and force it: 

SELECT MAX(timestamp) FROM table FORCE INDEX(timestamp_index)

In this case you'll be sure that it's fast enough. 

And, of course, as Ian Gibbons correcly mentioned, you can use MySQL-only way
to check the latest update time of a table: 

SHOW TABLE STATUS LIKE 'tablename';

and look for the Update_time field. 

> Martijn Tonies





-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   Egor.Egorov@stripped
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com



Thread
Last ModifiedPaul McNeil10 Jun
  • RE: How do you display last modified dateDan V10 Jun
  • Re: Last ModifiedMartijn Tonies10 Jun
    • Re: Last ModifiedAlec.Cawley10 Jun
  • Re: Last ModifiedCarsten R. Dreesbach10 Jun
Re: Last ModifiedMartijn Tonies10 Jun
  • Re: Last ModifiedAlec.Cawley10 Jun
  • Re: Last ModifiedEgor Egorov11 Jun