- 1、本文档共45页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
? Dennis Shasha, Philippe Bonnet 2001 Locking in Oracle 8i Data page row Interested transaction list (fixed array - INITRANS – MAXTRANS) T1 T1 lock Enqueue resource structure (fixed array – default 4 entries per transaction) T1 Enqueued locks array T2 lock Enqueue wait (time out ~ 3sec) Process T3 lock Deadlock detection H ? Dennis Shasha, Philippe Bonnet 2001 Locking Overhead -- data Settings: accounts( number, branchnum, balance); create clustered index c on accounts(number); 100000 rows Cold buffer SQL Server 7, DB2 v7.1 and Oracle 8i on Windows 2000 No lock escalation on Oracle; Parameter set so that there is no lock escalation on DB2; no control on SQL Server. Dual Xeon (550MHz,512Kb), 1Gb RAM, Internal RAID controller from Adaptec (80Mb), 4x18Gb drives (10000RPM), Windows 2000. ? Dennis Shasha, Philippe Bonnet 2001 Locking Overhead -- transactions No Concurrent Transactions: Update [10 000 updates]update accounts set balance = Val; Insert [10 000 inserts], e.g. typical one:insert into accounts values(664366,72255,2296.12); 2 - Tuning the Guts ? Dennis Shasha, Philippe Bonnet 2001 * Locking Overhead Row locking is barely more expensive than table locking because recovery overhead is higher than locking overhead Exception is updates on DB2 where table locking is distinctly less expensive than row locking. (DB2 use logical logging, which logs the operation that caused change instead of image of changed data) Data definition language (DDL) statementsare considered harmful DDL is the language used to access and manipulate catalog or metadata The catalog can easily become a hot spot and therefore a bottleneck The lesson is: avoid updates to the system catalog during heavy system activity, especially if you are using dynamic SQL ? Dennis Shasha, Philippe Bonnet 2001 Think about partitioning Problem: insert a collection records into history file or security file, or log file Time dependent insertion Last page of the file may become a concurrency bott
文档评论(0)