开发者

comparing databases and their locks

开发者 https://www.devze.com 2023-02-14 03:28 出处:网络
I have heavy transaction stuff going on and would like to gain information about how locks are implemented in current databases. Working on zero budget my choise is limited to mysql 5.5 and postgres 9

I have heavy transaction stuff going on and would like to gain information about how locks are implemented in current databases. Working on zero budget my choise is limited to mysql 5.5 and postgres 9.0.

Is there any site where the locks are compared?

From literature I know that you can have read-only and read-write locks and that a good way of handling locks is to block the the path to the data. That means blocking parts of the btree. But I can't find specifics on how these开发者_开发问答 to databases do their work.

Thanks alot.


Here is an overview for PostgreSQL

http://www.postgresql.org/docs/current/static/explicit-locking.html
http://www.postgresql.org/docs/current/static/locking-indexes.html

Not sure what you mean with "read-only lock", but in PostgreSQL the only way to "lock" a table from being read is to manually lock it using ACCESS EXCLUSIVE mode which is not something that happens with regular DML statements. Only a DDL statement (such as ALTER TABLE) would achieve this.


Maybe you'll find this book useful: Inside Microsoft SQL Server 2005: The Storage Engine. Read chapters "logging and recovery" and "locking and concurrency". A lot of information from this book is applied to many of today's database systems. It's really good book.

I suggest you to read about concurrency control. You can start from Concurrency_control wiki especially as of section |Database transaction and the ACID rules"

If you wanna compare locks, first I would read about problems occuring in transactions and about transaction isolation levels.


Check this: SQL Server 2008 Locking.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号