Re: How do "locks" work when doing deletes?
Posted in 1996
SE V5.01 etc only: if the database has TRANSACTIONS then deletes are logged. You will need one kernel lock per delete! LOCKing the TABLE does not reduce the lock requrement. So you need to turn off TRANSACTIONs before doing mass deletes. Any one know a quick cheap way of doing this? - apart from editing the systables definition? > >If I have a table having say a million rows called "ttable", and 2 > >users simultaneousIy execute a "delete from ttable;" command, will > >there be any table locks involved. . . > > As far as I know, table locks must be instantiated explicitly (LOCK TABLE > ttable IN EXCLUSIVE MODE), otherwise row/page level locks will be used. As > far as I'm aware, logging makes no difference. > > >a) . . .if the database has logging? > > > >b) . . .if the database does not have logging? > > > >c) . . .or how about if I have only 1 user performing the command? > > Would that make a difference with respect to a) & b)? > > HTH. > > Hasta la vista! > > -- > > billy.wheeler@pixie.co.za > > -- Martin How