vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| > > Never fear! > > We don't want use ROWID as primary key > > for manipulations on the database. > > We just need a unique id for each row > > in our client result set in a grid or in memory. > > * Do not use the ROWID > * If you really want to use it be aware that it changes > * whenever a row moves on disk - alter table, update of varchar, ... > * be aware that it is not unique in fragmented tables (unless WITH ROWID > is specified) > > I'm not proud but I've successfully used them. > > -- > Rob Wilson > rob_wilson_at_ameritech.net (replace _at_ with @) Actually, 'update of varchar' doesn't change the ROWID. If the new VARCHAR doesn't fit into the old page, a special link to the 'remainder' page is stored in place of the previous value on the original page, thus preserving the rowid from changing Only table rebuilds (non-inplace 'alter table', 'create cluster index') change the rowid I think it is quite safe to use ROWID's for repeated access to the same row (select -> verify -> update sequence) within a short transaction. It is faster, then index access (because it's direct addressing) sending to informix-list |
| ||||
| Alexey Sonkin <alexeis@grandvirtual.com> wrote in message news:<c230qf$9jp$1@terabinaries.xmission.com>... > > Actually, 'update of varchar' doesn't change the ROWID. > If the new VARCHAR doesn't fit into the old page, > a special link to the 'remainder' page is stored in place > of the previous value on the original page, thus preserving > the rowid from changing > > Only table rebuilds (non-inplace 'alter table', 'create cluster index') > change the rowid > > I think it is quite safe to use ROWID's for repeated access > to the same row (select -> verify -> update sequence) within a short > transaction. It is faster, then index access (because it's direct > addressing) > sending to informix-list Minor correction. The update of a varchar will not change the rowid unless there is also a pending in place alter for that page. If there is a pending IPA, then it is very possible that the version of the rows will be updated to the current version and rows will be moved arround. |