Re: which "where condition" I should use?
Posted in 1996
Systems Team <fa87@dial.pipex.com> wrote: :Madeline Wu wrote: :> :> Our engineer is ONLINE 5.0. :> When I set explain on, the result is: :> :> 1) update tables set field="value" where uniqe_index_value :> estimated cost: 1 :> :> 2) update tables set field="value" where rowid=num :> estimated cost: 13288 :> :> Is it mean "where condition" use uniqe index value :> is better than use rowid ?? Well, the estimate is off, but you still shouldn't use rowid unless there is absolutly no way around. :I would advise against using rowid for identifying rows. It is an "internal" field, with no :specific meaning to the (logical) record concerned. Thus its value is not preserved if the :table is re-organized in any way. Also, I thought that Informix were removing/have :removed(?) support for rowid in later versions of OnLine - True or False? In ver. 7.x there are still rowid's as in previous versions if you do not fragment the table. If you do fragment the table you have to create the table with rowid's if you want to use them. They are however then implemented as a standard serial column with an index. This means you can have no other serial column on the table. However including a serial column and excluding the rowid would give you the same performance and a vastly better database design. For all intents and purposes considder rowid's removed in version 7.x. If you don't all you can gain down the line is trouble. :Tim Kelly Nils.Myklebust@idg.no NM Data AS, P.O.Box 9090 Gronland, N-0133 Oslo, Norway My opinions are those of my company