Reply to Re: 'aging' tables

Your name:

Reply:


Posted by Robert Klemme on 01/10/07 11:52

On 10.01.2007 10:49, fireball wrote:
> I'm about to create some mechanism for control both: size of given table and
> age of it's entries. I wish it to delete entries if older then X , or last n
> entries when table is bigger then Y .
> I need opinion if it will be good to use ddl trigger mechanism (SS2005), or
> maybe someone would share another solution. It is supposed to be used only
> for some tables like log table, not for each table in database, I don't want
> to the mechanism decrease performance too much though.

In that case a batch like approach is probably better, i.e. once a day
run your cleanup job. If possible you should have a CI with the
timestamp as leading column to make deleting more efficient.

The easiest is deletion by age. Deleting the oldest n records is more
difficult. If you are on SQL 2005 you may be able to create something
with an analytic function (i.e. using "row_number").

Cheers

robert

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация