table-level lock or row-level lock

table-level lock or row-level lock

Post by lee_ » Fri, 19 Dec 2003 04:32:32



Hi,
    If I run an insert Sql statement to a table,which level lock that the
database will give to the statement,table-level or row-level?how about
update statement and delete statement.

Thanks
Jack

 
 
 

table-level lock or row-level lock

Post by Andrew J. Kell » Fri, 19 Dec 2003 05:54:45


Depends on several factors like what type of indexes / constraints you have
on the table, how many rows affected, if other users are in the table etc.
Assuming you have good indexes and are only selecting or updating just a few
rows it will most likely takeout row level locks.

--
Andrew J. Kelly  SQL MVP


Quote:> Hi,
>     If I run an insert Sql statement to a table,which level lock that the
> database will give to the statement,table-level or row-level?how about
> update statement and delete statement.

> Thanks
> Jack


 
 
 

1. table level locks, row level locks, column level locks?

Whenever I update a table
update table A set col1='1' where a.id between 1 and 10000

all rows lock  for updates that fall into that range,
so while this update is running if another update comes in
update table A set col2='2' where a.id between 100 and 150

it cannot complete until the first update completes and commits...
but the queries are updating difference columns.. is there are any new
features that allow you to differentiate those queries and let them
run concurently?

Thanx.
.......
We use Oracle 8.1.6-8.1.7 on Solaris 2.6, 2.7 boxes
Andrey Dmitriev  eFax: (978) 383-5892  Daytime: (917) 750-3630
AOL: NetComrade  ICQ: 11340726 remove NSPAM to email

2. Using Oracle Thin Driver with IE

3. row-level or page-level locking?

4. approach odbc driver

5. row level vs page level locking is it more than marketing

6. pgsql-server/ oc/src/sgml/protocol.sgml rc/bac ...

7. row level locking and dead-lock prevention

8. Help Wanted ..Compiling Universty Ingres for Linux !

9. Page lock to simulate row level lock

10. Paradox 5.0: Row level locking or page locking?

11. row level locking and dead-lock prevention

12. Page level, table level locks used.

13. oracle table/row level locking