Time stamping updates/inserts on records
Posted in 2000
Topics: General Discussion
Hi all. We are looking for an efficient way of time stamping inserts / updates on the records. We will also think to have an index on the time stamp. The tables can have millions of records, and the data can be fairly volatile (lots of inserts/updates). I have some questions to youy guys: 1. What will be an efficient way of doing this (adding a DATETIME, an integer with let's say seconds since January 1, 2000) ? 2. Since the time stamp always grows, will the index re-generation be fast, since only grows the B-tree in one direction ? Any help will be appreciated. Thanks, Bogdan Neagu
Bogdan Neagu wrote: > > Hi all. > > We are looking for an efficient way of time stamping inserts / updates on > the records. We will also think to have an index on the time stamp. > > The tables can have millions of records, and the data can be fairly > volatile (lots of inserts/updates). > > I have some questions to youy guys: > > 1. What will be an efficient way of doing this (adding a DATETIME, an > integer with let's say seconds since January 1, 2000) ? Either way. If you use a DATETIME YEAR TO SECOND you can populate it for INSERTs using a column DEFAULT and for UPDATES using an update trigger on ALL of the other columns except itself (which will allow you to manually update that column when needed without firing the trigger). If you do the SECONDS since date you will have to populate it in a trigger using a stored procedure and I think you would need a C or Java UDF to get the time to stamp it with so that means you need IDS.2000 (9.xx). > 2. Since the time stamp always grows, will the index re-generation be > fast, since only grows the B-tree in one direction ? Informix B+Trees are self balancing. Not a problem. Indeed when the engine builds them it sorts the keys into index order to speed building and the index is created balanced just fine. Art S. Kagel > Any help will be appreciated. > > Thanks, > > Bogdan Neagu
Hi, I once have used a dummy cdr (enterprise replication) (only one single machine involved) in order to get crcols. One of the crcols is populated with a time stamp. Bogdan Neagu wrote: > Hi all. > > We are looking for an efficient way of time stamping inserts / updates on > the records. We will also think to have an index on the time stamp. > > The tables can have millions of records, and the data can be fairly > volatile (lots of inserts/updates). > > I have some questions to youy guys: > > 1. What will be an efficient way of doing this (adding a DATETIME, an > integer with let's say seconds since January 1, 2000) ? > > 2. Since the time stamp always grows, will the index re-generation be > fast, since only grows the B-tree in one direction ? > > Any help will be appreciated. > > Thanks, > > Bogdan Neagu -- Mit freundlichen Grüßen / with best regards :-) +===================================Mail-Client: Netscape V4.75=+ | Ernst Sauerwein Siemens Busines Services | | =============== IT Services ISC-D 144 | | Microsoft Certified OLTP-Systems | | Professional INFORMIX® Database Support | | Tel: +49 89 3601 2699 Area South Europe | | FAX: +49 89 3601 2402 Berliner Str.95,III/D046 | | EMAIL: mailto:ernst.sauerwein@mch.siemens.de | | FTP: ftp://ftp.siemens.de/ (external) | | ftp://MB184060.mch.sni.de/ (internal) | | WWW: http://its.mch.sni.de/ (external) | | http://MB184060.mch.sni.de/ (internal) (v private) | | http://www.stud.uni-muenchen.de/~yaling.mo/Welcome.htm | +===============================================================+