Re: Row and page locking - yet to di(e)
Posted in 1997
Art S. Kagel wrote: } } Vijay R. Anisetti wrote: } > } > Bill Glidden wrote: } > > } > > davin_harvey@dsti.co.uk wrote: } > > : Hi everybody, } > > : =20 } > > : Does anyone know if there is a difference in the time it takes to=20 } > > : place a row lock rather than a page lock? } > > : =20 } > > : Ta } > > : Davin } > > } > > no difference that I can think of. } > } > Though there might be a difference between the two, it will be } > negligible } > should play no importance in the decision making. } > } > My theory is that a Page lock is quicker as there is a defined no. of } > bytes } > to lock all the time. Whereas for a row lock it requires to know the no. } > of } > bytes to lock and task of calculating the rowsize is compounded if it } > has any } > variable columns in size (varchar). } } No. Informix only has create a lock for the rowid. The only difference } between a page lock and a row lock is that a page lock is a lock on slot } number zero on the page. Since the rowid contains the page and slotno, } (the slot contains the actual row length) this is sufficient. The Ok agreed, this is a much more logical explanation. } Informix code just checks for any lock on the desired page for slot } zero if the table mode is page or for the specific slot/rowid if the } table's lock mode is row. Still, in the page-lock mode Informix needs to check only the zero slot(s) lock 'em and move on. Whereas in row-lock mode need to check for slot/rowid and maybe individual bytes (for varchar) within the page. So, that does take little more effort from the engine (though, might be negligible). } } Art S. Kagel -- ___________________ _____| Vijay |___ \\ | 'Bindas Dude' | / ) |___________________| ( /______) (____\\ (courtesy one of the postings here)