Update and Indexes
Posted in 2000
Topics: General Discussion
Hi all, Quick, and possibly simple, question: We have a table with 2 non-unique indexes. Our code is updating several rows in the table, updating several fields in those indexes. The data seems to corrupt, unless we "sleep 1" the code in between updates. Could this be caused by the indexes rebuilding themselves? Or is there something else Informix is doing behind the scenes? We are using Informix 7.31, by the way. Example ------- TableA : field1, ..., field10 Index (dupls) ind1 (field1, field2, field4, field5) Index (dupls) ind2 (field7, field8, field10) "Update tableA set field1=123, field2=456, field6='xxx', field8='yyy' where rowid=[previously selected rowid]" Why would Informix not be able to handle this Update without the 'sleep'? Thanks, Michael Hoffman
> Example > ------- > TableA : field1, ..., field10 > Index (dupls) ind1 (field1, field2, field4, field5) > Index (dupls) ind2 (field7, field8, field10) > > "Update tableA set field1=123, field2=456, field6='xxx', field8='yyy' > where rowid=[previously selected rowid]" > > Why would Informix not be able to handle this Update without the 'sleep'? > I don't understand. Where are you putting the sleep and why do you think the index is corrupt? What's happening? Is this an update just from regular SQL, 4GL, ESQL or something else? -- # unrm / ksh: unrm: not found # man cpio Sent via Deja.com http://www.deja.com/ Before you buy.
In <8813ra$6pf$1@nnrp1.deja.com> article, mars1972@my-deja.com mentioned that: :> Example :> ------- :> TableA : field1, ..., field10 :> Index (dupls) ind1 (field1, field2, field4, field5) :> Index (dupls) ind2 (field7, field8, field10) :> :> "Update tableA set field1=123, field2=456, field6='xxx', field8='yyy' :> where rowid=[previously selected rowid]" :> :> Why would Informix not be able to handle this Update without the : 'sleep'? :> : I don't understand. Where are you putting the sleep and why do you : think the index is corrupt? What's happening? Is this an update just : from regular SQL, 4GL, ESQL or something else? Sorry for the confusion: This is in the middle of a 4GL program. We were running the Update based on a Select cursor including the Rowid of the table. If we leave out the Sleep, the data, not the indexes, seems to be corrupt (sorry, that's what my programmer describes... I can't go into "how corrupted" detail). With the Sleep, however, all is fine, but the program is slowed down considerably. Michael Hoffman