Administração e Optimização de BDs 2º semestre

Size: px
Start display at page:

Download "Administração e Optimização de BDs 2º semestre"

Transcription

1 DepartamentodeEngenhariaInformática 2009/2010 AdministraçãoeOptimizaçãodeBDs2ºsemestre AuladeLaboratório8 Inthislabclasswewillapproachthefollowingtopics: 1. Basicsoflock,log,memory,CPUandI/Otuning 2. Tuninglocks 3. Tuninglogging 4. Tuningmemoryusage 5. TuningCPUusage 6. TuningI/Oandcaching 7. Otherresources 1. Basicsoflock,log,memory,CPUandI/Otuning Memory, CPU and disk access affects many different aspects of SQL Server, e.g. query execution,cachingandevenuserconnectionsandlocks.thereareconfigurationoptions andhintsthatcanbeusedtofine tunetheseaspects.differentqueriescanhavediverse memoryandcpurequirements.asimplequerysuchasasinglerowlookupwillrequire littlememoryandcputoexecute.otherqueries,suchastheadhocqueriesfoundindata warehouse type systems, may need to perform large sorts. Some queries will need to performhashjoinsonlargeamountsofdata.thequeriesthatneedtosortandhashwill benefitfromlotsofmemory.ifthesortcanfitintomemory,orthehashbucketscanfit intomemory,queryperformancewillbeimproved. Locking also brings lots of possibilities towards affecting performance. A good chunk of poorperformancethatyoumightnoticeinsystemsoccursbecauseprocessesarewaiting toeitheracquirealockorbreakfromadeadlock.normally,lockingoccursattherowlevel unless many adjacent rows on a page are locked, in which SQL server will automatically promotethelocktoapage level,orinextremecases,toatable levellock.fine tuningthis behaviorcansometimesbethekeyforachievingtherequiredlevelsofperformance. 1. Tuninglocks 1.1. Identifyinglong runningtransactions Onewaytohelpreducelockingissuesistoidentifythosetransactionsthataretakinga long time to run. The longer they take to run, the longer their locks will block other processes,causingcontentionandreducingperformance.thefollowingscriptcanberun toidentifycurrent,long runningtransactions.thiswillprovideyouwithaclueastowhat transactionsaretakingalongtime,allowingyoutoinvestigateandresolvethecause. IST/DEI Pág.1de7

2 AdministraçãoeOptimizaçãodeBasesdeDados SELECTspid,cmd,status,loginame,open_tran, datediff(s,last_batch,getdate())as[waittime(s)] FROMmaster..sysprocessespWHEREopen_tran>0ANDspid>50AND datediff(s,last_batch,getdate())>30and EXISTS(SELECT*FROMmaster..syslockinfol WHEREreq_spid=p.spidANDrsc_type<>2) Thisqueryprovidesresultsbasedontheinstantisruns,andwillvaryeachtimeyourunit. The goal is to review the results and look for transactions that have been open a long time.thisgenerallyindicatessomeproblemthatshouldbeinvestigated Lockgranularityandlockescalation SQLServersupportsrowlocking,butoftenusesrough grainedlocks.thisisbecauselock management is a complex issue. Locks aren't small or simple entities, so if you only do row level locking, you can get yourself into many problems: a million row update can easilyswampmemoryandbecomehardtomanage. Databases that do more than just row level locking often use a technique called lock escalation to achieve better performance. Unless its clear from the outset that a whole tablewillbemodified,thesedatabasesstartoffusingrowlocks,andtheymakeplansto trade these locks in for rough grained locks later if too many rows are modified.unfortunately, lock escalation amplifies the deadlocks problem. If two users try to modify semantically unrelated but physically near data in two separate tables in reverseorder,bothuserswillstartoffwithrowlocks,thentrytoupgradethemtopage locks, and the situation will be that each user wants something the other user has, so they're stuck. Databases that use only row level locking almost never have this problem because two users rarely want to modify the exact same row, and even more rarely do theyattainlocksintheorderneededtocauseadeadlock. Inpractice,underhighload,SQLServer'slockingsystemdoesnotperformwellduetolock contention(i.e,deadlocksandwaitingforlocks).becauseofsharedlocks,evenusersnot tryingtomodifythedatabaseareaffectedbythelocksystem.however,thenolockand ROWLOCKhintscanbeofsomehelp.Thesehintsareusedlikeintheexamplesbellow: SELECTCOUNT(EmployeeID)FROMHumanResources.EmployeeWITH(NOLOCK); UPDATEHumanResources.EmployeeWITH(ROWLOCK) SETEmployeeName='JohnDoe'WHEREEmployeeID=100; SELECTCOUNT(E.EmployeeID)FROMHumanResources.EmployeeASEWITH (NOLOCK)JOINHumanResources.EmployeeAddressASE2WITH(NOLOCK) ONE.EmployeeID=E2.EmployeeID; IST/DEI Pág.2de7

3 AdministraçãoeOptimizaçãodeBasesdeDados NOLOCK politely asks SQL Server to ignore locks and read directly from the tables. This means you completely circumvent the lock system, which is a major performance and scalabilityimprovement.however,youalsocompletelycircumventthelocksystem,which means you may read the not necessarily valid uncommitted modifications of a running transaction. ROWLOCK politely asks SQL Server to only use row level locks. You'd think that an UPDATEinwhichyouspecifytheprimarykeywouldalwayscausearowlock,butwhen SQLServergetsabatchwithmanyofthese,andsomeofthemhappentobeinthesame page, you'll see page locks. And if you don't specify a primary key for an UPDATE or DELETE,there'snoreasonthedatabasewouldn'tassumethatalotwon'tbeaffected,soit probably goes right to page locks.by specifically requesting row level locks, these problems are avoided. However, be aware that if you are wrong and lots of rows are affected,eitherthedatabasewilltaketheinitiativeandescalatetopagelocks,oryouwill haveamanyrowlocksfillingyourserver'smemoryandbringingdownperformance BesidestuningSQLinstructionswiththeaboveHINTS,othercommonrecommendations aregivenext: Ontablesthatchangelittle,ifatall,suchaslookuptables,consideralteringthedefault locklevelforthesetables.sincelookuptablesarenotbeingchangedbyusers,itwould be more efficient to use a table lock instead of many individual row locks. You can override how SQL Server performs locking on a table by using the SP_INDEXOPTION command. Below is an example of code you can run to tell SQL Server to use page locking,notrowlocks,foraspecifictable: SP_INDEXOPTION'table_name','AllowRowLocks',FALSE; SP_INDEXOPTION'table_name','AllowPageLocks',FALSE; Thiscodeturnsoffbothrowandpagelocking,andthusonlytablelockingisavailable. Ifthereisalotofcontentionforaparticulartableinyourdatabase,considerturningoff pagelockingforthattable,requiringsqlservertouserowlevellocking.thiswillhelpto reducethecontentionforrowslocatedonthesamepage.itwillalsocausesqlserverto workalittleharderinordertotrackalloftherowlocks.howwellthisoptionwillworkfor youdependsonthetradeoffinperformancebetweenthecontentionandtheextrawork SQL Server has to perform to maintain many row locks. Testing will be needed to determinewhatisbestforyourparticularenvironment.usethesp_indexoptionstored proceduretoturnoffpagelockingforanyparticulartable. Keepalltransactionsasshortaspossible.Thishelpstoreducethenumberoflocks(ofall types),helpingtospeeduptheoverallperformanceofyoursqlserverapplications. IST/DEI Pág.3de7

4 AdministraçãoeOptimizaçãodeBasesdeDados To help reduce the amount of time tables are locked, which hurts concurrency and performance, avoid interleaving reads and database changes within the same transaction. Instead, try to do all your reads first, then perform all of the database changes (UPDATES, INSERTS, DELETES) near the end of the transaction. This helps to minimizetheamountoftimethatexclusivelocksareheld. Iftablescansareusedregularlytoaccessatable,andyourtabledoesn'thaveanyuseful indexes to prevent this, then consider turning off both row locking and page locking for that table. This in effect tells SQL Server to only use table locking when accessing this table.thiswillboostaccesstothistablebecausesqlserverwillnothavetoescalatefrom rowlocking,topagelocking,totablelockingeachtimeatablelockisneededtoperform thetablescan.onthenegativeside,doingthiscanincreasecontentionforthetable. 2. Tuninglogging Forperformancereasons,theDatabaseEngineperformsmodificationstodatabasepages inmemoryanddoesnotwritethepagetodiskaftereverychange.however,periodically, the Database Engine needs to perform a checkpoint to write these dirty pages to disk. WritingdirtypagestodiskcreatesaknowngoodpointfromwhichtheDatabaseEngine canstartapplyingchangescontainedinthelogduringrecovery. Beforeadatabasebackup,theDBEngineautomaticallyperformsacheckpointsothatall changestothedatabasepagesarecontainedinthebackup.stoppingaserveralsoissues a checkpoint in each database. In addition, checkpoints can be specified by the users throughthecheckpointinstruction,ortheycanoccurautomaticallywheneitherofthe followingconditionsoccur: The active portion of the log exceeds the size that the server could recover in the amountoftimespecifiedintherecoveryintervalserverconfigurationoption. Thelogbecomes70percentfull,andthedatabaseisinlog truncatemode. AdatabaseisinlogtruncatemodewhenboththeseconditionsareTRUE:thedatabaseis using the Simple recovery model, and, after execution of the last BACKUP DATABASE statementthatreferencedthedatabase,oneofthefollowingeventsoccurs: Aminimallyloggedoperationisperformedinthedatabase(e.g.,abulkcopyoperation). AnALTERDATABASEstatementisexecutedthataddsordeletesafileinthedatabase. ABACKUPLOGstatementreferencingthedatabaseisexecutedwitheithertheNO_LOG ortruncate_onlyclauses. IST/DEI Pág.4de7

5 AdministraçãoeOptimizaçãodeBasesdeDados In general, the amount time required for a checkpoint operation increases with the number of dirty pages that the operation must write. To minimize the performance impactonotherapplications,sqlserver,bydefault,adjuststhefrequencyofwritesthata checkpoint operation performs. SQL Server uses this strategy for automatic checkpoints and for any CHECKPOINT statement that does not specify a checkpoint_duration value. Decreasingthewritefrequencyincreasesthetimethecheckpointoperation. CHECKPOINT[checkpoint_duration]; Users can use checkpoint_duration to request that the checkpoint operation complete within a specific amount of time. The performance impact of using checkpoint_duration dependsonthenumberofdirtypages,theactivityonthesystem,andtheactualduration specified. For example, if the checkpoint would normally complete in 120 seconds, specifying a checkpoint_duration of 45 seconds causes SQL Server to devote more resourcestothecheckpointthanwouldbeassignedbydefault.incontrast,specifyinga checkpoint_duration of 180 seconds causes SQL Server to assign fewer resources than would be assigned by default. In general, a short checkpoint_duration will increase the resources devoted to the checkpoint, while a long checkpoint_duration will reduce the resources devoted to the checkpoint. SQL Server always completes a checkpoint if possible, and the CHECKPOINT statement returns immediately when a checkpoint completes. Therefore, in some cases, a checkpoint may complete sooner than the specifieddurationormayrunlongerthanthespecifiedduration. 3. Tuningmemoryusage Two server configuration options, min server memory (MB) and max server memory (MB), can be used to specify upper and lower bounds for the memory an SQL Server instance will use. The SQL Server documentation discusses the issue of how to properly settheseconfigurationparameters( US/). Thesetwoserveroptionscanbesetsothattheirvaluesareequal.Inthissituation,once the instance has grown its memory to that value, it should not increase or decrease it. These server configuration options can be set with the system stored procedure sp_configureorwiththesqlservermanagementstudio.whentheinstanceisstarted,it takes as much memory as it needs to initialize. This may well be below the min server memory(mb)value.however,onceithascrossedthisvalue,itshouldnotdropbelowit. This ensures that even if the instance is not busy, some memory will be kept ready for starting queries. Thus performance is not degraded by the instance trying to suddenly acquirememoryithasgivenup.themaxservermemory(mb)valueplacesanupperlimit onthememorytheinstancewilluse. IST/DEI Pág.5de7

6 AdministraçãoeOptimizaçãodeBasesdeDados Theindexcreatememoryconfigurationoptioncontrolstheamountofmemoryusedby sortoperationsduringindexcreation.whencreatingindexesinfrequentlyandduringoffpeak time, increasing this number can improve the performance of index creation. However,itisadvisabletokeeptheíndexcreatememoryoptionatalowernumber,so theindexcreationjobstillstartsevenifalltherequestedmemoryisnotavailable. The min memory per query server configuration option can be used to specify the minimumamountofmemorythatisallocatedfortheexecutionofaquery.whenthere are many queries executing concurrently in a system, increasing the value of the min memoryperquerycanhelpimprovetheperformanceofmemory intensivequeries,such assubstantialsortandhashoperations.however,donotsettheminmemoryperquery serverconfigurationoptiontoohigh,especiallyonverybusysystems,becausethequery hastowaituntilitcansecuretheminimummemoryrequestedoruntilthevaluespecified in the query wait server configuration option is exceeded. If more memory is available than the specified minimum value, the query is allowed to make use of the additional memory,providedthatthememorycanbeusedeffectivelybythequery. 4. TuningCPUusage In SQL Server, a single query can execute in parallel over multiple CPUs. For workloads that have a small number of complex queries running on SMP computers, this should bringaperformanceboost.foroltpworkloads,whichconsistofmanysmalltransactions, parallelism is unlikely to enhance performance. However, longer queries usually benefit fromparallelexecutionplans. Therearetwoserverconfigurationoptionsthataffectparallelqueryprocessing: ThemaxdegreeofparallelismoptioncontrolsthenumberofCPUsSQLServercanusefor parallelqueries thatis,themaximumnumberofthreadsaquerycanuse.thedefaultis to use all the processors. There is also a query optimizer hint, which can be used to influence parallel query execution. The MAXDOP query hint allows the max degree of parallelismtobesetonastatement by statementbasis. Thecostthresholdforparallelismcontrolsthethresholdoverwhichthequeryoptimizer generates a parallel plan. SQL Server creates and runs a parallel plan only when the estimatedcosttorunaserialplanforthesamequeryishigherthanthevaluesetincost thresholdforparallelism.thecostreferstoanestimatedelapsedtimeinsecondsrequired toruntheserialplanonaspecifichardwareconfiguration.thedefaultisfiveseconds. IST/DEI Pág.6de7

7 AdministraçãoeOptimizaçãodeBasesdeDados 5. TuningI/Oandcaching In previous labs, we have already looked at how databases, tables and indexes can be partitionedthroughmultipledevices,inordertofine tunei/operformance.wewillnow discussi/otuningaspectsrelatedtocachingbehaviorandrowprefetching. Read aheadprocessingisamechanismusedbysqlservertoreducethenumberofstalls a thread experiences waiting for a physical read to complete. It is a concept similar to instructionprefetchinacpu.ifsqlserverrealizesthatatablescanoranindexscanis taking place in other words, sequential scanning of pages it can start to prefetch pagesintothedatacachebeforethethreadrequeststhosepages. SQLServerusesanLRUstrategyforupdatingthedatacache.Tablesandindexesthatare accessedfrequentlystayinthecache,whileother,leastusedpagesareflushedoutfirst. In this way the pages that are often required are the pages that connections get fast accessto.however,itispossiblethatfastaccessisrequiredtotablesandindexesthatare notaccessedfrequentlyenoughtokeeptheminthedatacache. Tokeepatableanditsindexesindatacacheusethesp_tableoptionstoredprocedure: EXECsp_tableoption'table_name','pintable',true; Thetablenamecanusewildcardcharacters.Thisstatementdoesnotloadpagesfromthe tableintothedatacache,butoncetheyarereadintodatacachebynormalactivity,they stay there and are not removed. This can result in little data cache being left for other tablesandindexes,sotablepinningshouldbeusedwithcare. Toturntheoptionoff,justusethefalsekeyword,asfollows: EXECsp_tableoption'table_name','pintable',false; IST/DEI Pág.7de7

Administração e Optimização de BDs 2º semestre

Administração e Optimização de BDs 2º semestre DepartamentodeEngenhariaInformática 2008/2009 AdministraçãoeOptimizaçãodeBDs2ºsemestre AuladeLaboratório9 Inthislabclasswewillapproachthefollowingtopics: 1. IndextuningandSQLServer sdatabasetuningadvisor

More information

! Design constraints. " Component failures are the norm. " Files are huge by traditional standards. ! POSIX-like

! Design constraints.  Component failures are the norm.  Files are huge by traditional standards. ! POSIX-like Cloud background Google File System! Warehouse scale systems " 10K-100K nodes " 50MW (1 MW = 1,000 houses) " Power efficient! Located near cheap power! Passive cooling! Power Usage Effectiveness = Total

More information

Tuesday, April 6, Inside SQL Server

Tuesday, April 6, Inside SQL Server Inside SQL Server Thank you Goals What happens when a query runs? What each component does How to observe what s going on Delicious SQL Cake Delicious SQL Cake Delicious SQL Cake Delicious SQL Cake Delicious

More information

bobpusateri.com heraflux.com linkedin.com/in/bobpusateri. Solutions Architect

bobpusateri.com heraflux.com linkedin.com/in/bobpusateri. Solutions Architect 1 @sqlbob bobpusateri.com heraflux.com linkedin.com/in/bobpusateri Specialties / Focus Areas / Passions: Performance Tuning & Troubleshooting Very Large Databases SQL Server Storage Engine High Availability

More information

Administração e Optimização de BDs 2º semestre

Administração e Optimização de BDs 2º semestre DepartamentodeEngenhariaInformática 2008/2009 AdministraçãoeOptimizaçãodeBDs2ºsemestre AuladeLaboratório3 Inthislabclasswewillapproachthefollowingtopics: 1. BasicsofQueryProcessinginSQLServer2008 2. FullTableScans

More information

Module 15: Managing Transactions and Locks

Module 15: Managing Transactions and Locks Module 15: Managing Transactions and Locks Overview Introduction to Transactions and Locks Managing Transactions SQL Server Locking Managing Locks Introduction to Transactions and Locks Transactions Ensure

More information

Outline. Database Tuning. Ideal Transaction. Concurrency Tuning Goals. Concurrency Tuning. Nikolaus Augsten. Lock Tuning. Unit 8 WS 2013/2014

Outline. Database Tuning. Ideal Transaction. Concurrency Tuning Goals. Concurrency Tuning. Nikolaus Augsten. Lock Tuning. Unit 8 WS 2013/2014 Outline Database Tuning Nikolaus Augsten University of Salzburg Department of Computer Science Database Group 1 Unit 8 WS 2013/2014 Adapted from Database Tuning by Dennis Shasha and Philippe Bonnet. Nikolaus

More information

The former pager tasks have been replaced in 7.9 by the special savepoint tasks.

The former pager tasks have been replaced in 7.9 by the special savepoint tasks. 1 2 3 4 With version 7.7 the I/O interface to the operating system has been reimplemented. As of version 7.7 different parameters than in version 7.6 are used. The improved I/O system has the following

More information

Database Management and Tuning

Database Management and Tuning Database Management and Tuning Concurrency Tuning Johann Gamper Free University of Bozen-Bolzano Faculty of Computer Science IDSE Unit 8 May 10, 2012 Acknowledgements: The slides are provided by Nikolaus

More information

Introduction. Storage Failure Recovery Logging Undo Logging Redo Logging ARIES

Introduction. Storage Failure Recovery Logging Undo Logging Redo Logging ARIES Introduction Storage Failure Recovery Logging Undo Logging Redo Logging ARIES Volatile storage Main memory Cache memory Nonvolatile storage Stable storage Online (e.g. hard disk, solid state disk) Transaction

More information

Database Administration and Tuning

Database Administration and Tuning Department of Computer Science and Engineering 2012/2013 Database Administration and Tuning Lab 5 2nd semester In this lab class we will approach the following topics: 1. Important Concepts 1. Transaction

More information

In This Lecture. Transactions and Recovery. Transactions. Transactions. Isolation and Durability. Atomicity and Consistency. Transactions Recovery

In This Lecture. Transactions and Recovery. Transactions. Transactions. Isolation and Durability. Atomicity and Consistency. Transactions Recovery In This Lecture Database Systems Lecture 15 Natasha Alechina Transactions Recovery System and Media s Concurrency Concurrency problems For more information Connolly and Begg chapter 20 Ullmanand Widom8.6

More information

6.830 Lecture Recovery 10/30/2017

6.830 Lecture Recovery 10/30/2017 6.830 Lecture 14 -- Recovery 10/30/2017 Have been talking about transactions Transactions -- what do they do? Awesomely powerful abstraction -- programmer can run arbitrary mixture of commands that read

More information

The Google File System

The Google File System The Google File System Sanjay Ghemawat, Howard Gobioff, and Shun-Tak Leung Google SOSP 03, October 19 22, 2003, New York, USA Hyeon-Gyu Lee, and Yeong-Jae Woo Memory & Storage Architecture Lab. School

More information

6.830 Lecture Recovery 10/30/2017

6.830 Lecture Recovery 10/30/2017 6.830 Lecture 14 -- Recovery 10/30/2017 Have been talking about transactions Transactions -- what do they do? Awesomely powerful abstraction -- programmer can run arbitrary mixture of commands that read

More information

DBMS Performance Tuning

DBMS Performance Tuning DBMS Performance Tuning DBMS Architecture GCF SCF PSF OPF QEF RDF QSF ADF SXF GWF DMF Shared Memory locks log buffers Recovery Server Work Areas Databases log file DBMS Servers Manages client access to

More information

InnoDB Scalability Limits. Peter Zaitsev, Vadim Tkachenko Percona Inc MySQL Users Conference 2008 April 14-17, 2008

InnoDB Scalability Limits. Peter Zaitsev, Vadim Tkachenko Percona Inc MySQL Users Conference 2008 April 14-17, 2008 InnoDB Scalability Limits Peter Zaitsev, Vadim Tkachenko Percona Inc MySQL Users Conference 2008 April 14-17, 2008 -2- Who are the Speakers? Founders of Percona Inc MySQL Performance and Scaling consulting

More information

Locking & Blocking Made Simple

Locking & Blocking Made Simple Locking & Blocking Made Simple Joe Webb Microsoft SQL Server MVP WebbTech Solutions, LLC joew@webbtechsolutions.com Our Agenda The Nature of Multi-User Databases The Basics of Locking and Blocking Techniques

More information

MySQL Performance Optimization and Troubleshooting with PMM. Peter Zaitsev, CEO, Percona Percona Technical Webinars 9 May 2018

MySQL Performance Optimization and Troubleshooting with PMM. Peter Zaitsev, CEO, Percona Percona Technical Webinars 9 May 2018 MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev, CEO, Percona Percona Technical Webinars 9 May 2018 Few words about Percona Monitoring and Management (PMM) 100% Free, Open Source

More information

1.2 - The Effect of Indexes on Queries and Insertions

1.2 - The Effect of Indexes on Queries and Insertions Department of Computer Science and Engineering Data Administration in Information Systems Lab 2 In this lab class, we will approach the following topics: 1. Important Concepts 1. Clustered and Non-Clustered

More information

File Structures and Indexing

File Structures and Indexing File Structures and Indexing CPS352: Database Systems Simon Miner Gordon College Last Revised: 10/11/12 Agenda Check-in Database File Structures Indexing Database Design Tips Check-in Database File Structures

More information

The Google File System

The Google File System The Google File System Sanjay Ghemawat, Howard Gobioff and Shun Tak Leung Google* Shivesh Kumar Sharma fl4164@wayne.edu Fall 2015 004395771 Overview Google file system is a scalable distributed file system

More information

Outline. Failure Types

Outline. Failure Types Outline Database Tuning Nikolaus Augsten University of Salzburg Department of Computer Science Database Group 1 Unit 10 WS 2013/2014 Adapted from Database Tuning by Dennis Shasha and Philippe Bonnet. Nikolaus

More information

!! What is virtual memory and when is it useful? !! What is demand paging? !! When should pages in memory be replaced?

!! What is virtual memory and when is it useful? !! What is demand paging? !! When should pages in memory be replaced? Chapter 10: Virtual Memory Questions? CSCI [4 6] 730 Operating Systems Virtual Memory!! What is virtual memory and when is it useful?!! What is demand paging?!! When should pages in memory be replaced?!!

More information

SQL Server 2014: In-Memory OLTP for Database Administrators

SQL Server 2014: In-Memory OLTP for Database Administrators SQL Server 2014: In-Memory OLTP for Database Administrators Presenter: Sunil Agarwal Moderator: Angela Henry Session Objectives And Takeaways Session Objective(s): Understand the SQL Server 2014 In-Memory

More information

Oracle Hyperion Profitability and Cost Management

Oracle Hyperion Profitability and Cost Management Oracle Hyperion Profitability and Cost Management Configuration Guidelines for Detailed Profitability Applications November 2015 Contents About these Guidelines... 1 Setup and Configuration Guidelines...

More information

mysql Certified MySQL 5.0 DBA Part I

mysql Certified MySQL 5.0 DBA Part I mysql 005-002 Certified MySQL 5.0 DBA Part I http://killexams.com/exam-detail/005-002 QUESTION: 116 Which of the following correctly defines the general difference between a read lock and a write lock?

More information

Concurrency Control Goals

Concurrency Control Goals Lock Tuning Concurrency Control Goals Concurrency Control Goals Correctness goals Serializability: each transaction appears to execute in isolation The programmer ensures that serial execution is correct.

More information

Kathleen Durant PhD Northeastern University CS Indexes

Kathleen Durant PhD Northeastern University CS Indexes Kathleen Durant PhD Northeastern University CS 3200 Indexes Outline for the day Index definition Types of indexes B+ trees ISAM Hash index Choosing indexed fields Indexes in InnoDB 2 Indexes A typical

More information

Transaction Management Overview. Transactions. Concurrency in a DBMS. Chapter 16

Transaction Management Overview. Transactions. Concurrency in a DBMS. Chapter 16 Transaction Management Overview Chapter 16 Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke 1 Transactions Concurrent execution of user programs is essential for good DBMS performance. Because

More information

L9: Storage Manager Physical Data Organization

L9: Storage Manager Physical Data Organization L9: Storage Manager Physical Data Organization Disks and files Record and file organization Indexing Tree-based index: B+-tree Hash-based index c.f. Fig 1.3 in [RG] and Fig 2.3 in [EN] Functional Components

More information

Index Tuning. Index. An index is a data structure that supports efficient access to data. Matching records. Condition on attribute value

Index Tuning. Index. An index is a data structure that supports efficient access to data. Matching records. Condition on attribute value Index Tuning AOBD07/08 Index An index is a data structure that supports efficient access to data Condition on attribute value index Set of Records Matching records (search key) 1 Performance Issues Type

More information

About Speaker. Shrwan Krishna Shrestha. /

About Speaker. Shrwan Krishna Shrestha. / PARTITION About Speaker Shrwan Krishna Shrestha shrwan@sqlpassnepal.org / shrwan@gmail.com 98510-50947 Topics to be covered Partition in earlier versions Table Partitioning Overview Benefits of Partitioned

More information

Transaction Management Overview

Transaction Management Overview Transaction Management Overview Chapter 16 CSE 4411: Database Management Systems 1 Transactions Concurrent execution of user programs is essential for good DBMS performance. Because disk accesses are frequent,

More information

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Database Systems: Fall 2008 Quiz II

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Database Systems: Fall 2008 Quiz II Department of Electrical Engineering and Computer Science MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.830 Database Systems: Fall 2008 Quiz II There are 14 questions and 11 pages in this quiz booklet. To receive

More information

Engineering Robust Server Software

Engineering Robust Server Software Engineering Robust Server Software Scalability Other Scalability Issues Database Load Testing 2 Databases Most server applications use databases Very complex pieces of software Designed for scalability

More information

CS 186 Databases. and SID:

CS 186 Databases. and SID: Prof. Brewer Fall 2015 CS 186 Databases Midterm 3 Print your name:, (last) (first) I am aware of the Berkeley Campus Code of Student Conduct and acknowledge that academic misconduct will be reported to

More information

Lecture X: Transactions

Lecture X: Transactions Lecture X: Transactions CMPT 401 Summer 2007 Dr. Alexandra Fedorova Transactions A transaction is a collection of actions logically belonging together To the outside world, a transaction must appear as

More information

6.033 Computer System Engineering

6.033 Computer System Engineering MIT OpenCourseWare http://ocw.mit.edu 6.033 Computer System Engineering Spring 2009 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. 6.033 2009 Lecture

More information

Dynamic Metadata Management for Petabyte-scale File Systems

Dynamic Metadata Management for Petabyte-scale File Systems Dynamic Metadata Management for Petabyte-scale File Systems Sage Weil Kristal T. Pollack, Scott A. Brandt, Ethan L. Miller UC Santa Cruz November 1, 2006 Presented by Jae Geuk, Kim System Overview Petabytes

More information

Administração e Optimização de Bases de Dados 2012/2013 Index Tuning

Administração e Optimização de Bases de Dados 2012/2013 Index Tuning Administração e Optimização de Bases de Dados 2012/2013 Index Tuning Bruno Martins DEI@Técnico e DMIR@INESC-ID Index An index is a data structure that supports efficient access to data Condition on Index

More information

MySQL Performance Optimization and Troubleshooting with PMM. Peter Zaitsev, CEO, Percona

MySQL Performance Optimization and Troubleshooting with PMM. Peter Zaitsev, CEO, Percona MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev, CEO, Percona In the Presentation Practical approach to deal with some of the common MySQL Issues 2 Assumptions You re looking

More information

CSE 530A ACID. Washington University Fall 2013

CSE 530A ACID. Washington University Fall 2013 CSE 530A ACID Washington University Fall 2013 Concurrency Enterprise-scale DBMSs are designed to host multiple databases and handle multiple concurrent connections Transactions are designed to enable Data

More information

Datenbanksysteme II: Caching and File Structures. Ulf Leser

Datenbanksysteme II: Caching and File Structures. Ulf Leser Datenbanksysteme II: Caching and File Structures Ulf Leser Content of this Lecture Caching Overview Accessing data Cache replacement strategies Prefetching File structure Index Files Ulf Leser: Implementation

More information

Distributed Computation Models

Distributed Computation Models Distributed Computation Models SWE 622, Spring 2017 Distributed Software Engineering Some slides ack: Jeff Dean HW4 Recap https://b.socrative.com/ Class: SWE622 2 Review Replicating state machines Case

More information

Seminar 3. Transactions. Concurrency Management in MS SQL Server

Seminar 3. Transactions. Concurrency Management in MS SQL Server Seminar 3 Transactions Concurrency Management in MS SQL Server Transactions in SQL Server SQL Server uses transactions to compose multiple operations in a single unit of work. Each user's work is processed

More information

Squall: Fine-Grained Live Reconfiguration for Partitioned Main Memory Databases

Squall: Fine-Grained Live Reconfiguration for Partitioned Main Memory Databases Squall: Fine-Grained Live Reconfiguration for Partitioned Main Memory Databases AARON J. ELMORE, VAIBHAV ARORA, REBECCA TAFT, ANDY PAVLO, DIVY AGRAWAL, AMR EL ABBADI Higher OLTP Throughput Demand for High-throughput

More information

Processor : Intel Pentium D3.0 GigaHtz

Processor : Intel Pentium D3.0 GigaHtz CHALAPATHI INSTITUTE OF ENGINEERING & TECHNOLOGY CHALAPATHI NAGAR LAM,GUNTUR DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING INTRODUCTION ABOUT 'L2' LAB There are 30 systems (HCL) installed in this Lab.

More information

Optimizing Performance for Partitioned Mappings

Optimizing Performance for Partitioned Mappings Optimizing Performance for Partitioned Mappings 1993-2015 Informatica LLC. No part of this document may be reproduced or transmitted in any form, by any means (electronic, photocopying, recording or otherwise)

More information

MITOCW ocw apr k

MITOCW ocw apr k MITOCW ocw-6.033-32123-06apr2005-220k Good afternoon. So we're going to continue our discussion about atomicity and how to achieve atomicity. And today the focus is going to be on implementing this idea

More information

Optimizing RDM Server Performance

Optimizing RDM Server Performance TECHNICAL WHITE PAPER Optimizing RDM Server Performance A Raima Inc. Technical Whitepaper Published: August, 2008 Author: Paul Johnson Director of Marketing Copyright: Raima Inc., All rights reserved Abstract

More information

What are Transactions? Transaction Management: Introduction (Chap. 16) Major Example: the web app. Concurrent Execution. Web app in execution (CS636)

What are Transactions? Transaction Management: Introduction (Chap. 16) Major Example: the web app. Concurrent Execution. Web app in execution (CS636) What are Transactions? Transaction Management: Introduction (Chap. 16) CS634 Class 14, Mar. 23, 2016 So far, we looked at individual queries; in practice, a task consists of a sequence of actions E.g.,

More information

Database Architecture 2 & Storage. Instructor: Matei Zaharia cs245.stanford.edu

Database Architecture 2 & Storage. Instructor: Matei Zaharia cs245.stanford.edu Database Architecture 2 & Storage Instructor: Matei Zaharia cs245.stanford.edu Summary from Last Time System R mostly matched the architecture of a modern RDBMS» SQL» Many storage & access methods» Cost-based

More information

CA485 Ray Walshe Google File System

CA485 Ray Walshe Google File System Google File System Overview Google File System is scalable, distributed file system on inexpensive commodity hardware that provides: Fault Tolerance File system runs on hundreds or thousands of storage

More information

Advanced Database Systems

Advanced Database Systems Lecture IV Query Processing Kyumars Sheykh Esmaili Basic Steps in Query Processing 2 Query Optimization Many equivalent execution plans Choosing the best one Based on Heuristics, Cost Will be discussed

More information

The Google File System (GFS)

The Google File System (GFS) 1 The Google File System (GFS) CS60002: Distributed Systems Antonio Bruto da Costa Ph.D. Student, Formal Methods Lab, Dept. of Computer Sc. & Engg., Indian Institute of Technology Kharagpur 2 Design constraints

More information

Transaction Management: Introduction (Chap. 16)

Transaction Management: Introduction (Chap. 16) Transaction Management: Introduction (Chap. 16) CS634 Class 14 Slides based on Database Management Systems 3 rd ed, Ramakrishnan and Gehrke What are Transactions? So far, we looked at individual queries;

More information

Distributed File Systems II

Distributed File Systems II Distributed File Systems II To do q Very-large scale: Google FS, Hadoop FS, BigTable q Next time: Naming things GFS A radically new environment NFS, etc. Independence Small Scale Variety of workloads Cooperation

More information

Jyotheswar Kuricheti

Jyotheswar Kuricheti Jyotheswar Kuricheti 1 Agenda: 1. Performance Tuning Overview 2. Identify Bottlenecks 3. Optimizing at different levels : Target Source Mapping Session System 2 3 Performance Tuning Overview: 4 What is

More information

Google Disk Farm. Early days

Google Disk Farm. Early days Google Disk Farm Early days today CS 5204 Fall, 2007 2 Design Design factors Failures are common (built from inexpensive commodity components) Files large (multi-gb) mutation principally via appending

More information

Building Better. SQL Server Databases

Building Better. SQL Server Databases Building Better SQL Server Databases Who is this guy? Eric Cobb SQL Server Database Administrator MCSE: Data Platform MCSE: Data Management and Analytics 1999-2013: Webmaster, Programmer, Developer 2014+:

More information

Concurrency Control & Recovery

Concurrency Control & Recovery Transaction Management Overview CS 186, Fall 2002, Lecture 23 R & G Chapter 18 There are three side effects of acid. Enhanced long term memory, decreased short term memory, and I forget the third. - Timothy

More information

Data Modeling and Databases Ch 10: Query Processing - Algorithms. Gustavo Alonso Systems Group Department of Computer Science ETH Zürich

Data Modeling and Databases Ch 10: Query Processing - Algorithms. Gustavo Alonso Systems Group Department of Computer Science ETH Zürich Data Modeling and Databases Ch 10: Query Processing - Algorithms Gustavo Alonso Systems Group Department of Computer Science ETH Zürich Transactions (Locking, Logging) Metadata Mgmt (Schema, Stats) Application

More information

Database Management Systems Buffer manager

Database Management Systems Buffer manager Database Management Systems Buffer manager D B M G 1 DBMS Architecture SQL INSTRUCTION OPTIMIZER MANAGEMENT OF ACCESS METHODS CONCURRENCY CONTROL BUFFER MANAGER RELIABILITY MANAGEMENT Index Files Data

More information

Lock Tuning. Concurrency Control Goals. Trade-off between correctness and performance. Correctness goals. Performance goals.

Lock Tuning. Concurrency Control Goals. Trade-off between correctness and performance. Correctness goals. Performance goals. Lock Tuning Concurrency Control Goals Performance goals Reduce blocking One transaction waits for another to release its locks Avoid deadlocks Transactions are waiting for each other to release their locks

More information

Data Modeling and Databases Ch 9: Query Processing - Algorithms. Gustavo Alonso Systems Group Department of Computer Science ETH Zürich

Data Modeling and Databases Ch 9: Query Processing - Algorithms. Gustavo Alonso Systems Group Department of Computer Science ETH Zürich Data Modeling and Databases Ch 9: Query Processing - Algorithms Gustavo Alonso Systems Group Department of Computer Science ETH Zürich Transactions (Locking, Logging) Metadata Mgmt (Schema, Stats) Application

More information

STORING DATA: DISK AND FILES

STORING DATA: DISK AND FILES STORING DATA: DISK AND FILES CS 564- Spring 2018 ACKs: Dan Suciu, Jignesh Patel, AnHai Doan WHAT IS THIS LECTURE ABOUT? How does a DBMS store data? disk, SSD, main memory The Buffer manager controls how

More information

Recovery and Logging

Recovery and Logging Recovery and Logging Computer Science E-66 Harvard University David G. Sullivan, Ph.D. Review: ACID Properties A transaction has the following ACID properties: Atomicity: either all of its changes take

More information

Overview of Transaction Management

Overview of Transaction Management Overview of Transaction Management Chapter 16 Comp 521 Files and Databases Fall 2010 1 Database Transactions A transaction is the DBMS s abstract view of a user program: a sequence of database commands;

More information

5/7/13. Mission Critical Databases. Introduction AOBD

5/7/13. Mission Critical Databases. Introduction AOBD Mission Critical Databases AOBD 30 April 2013 1 Introduction Paulo Ferro Graduated in Information Systems and Computer Engineering (LEIC) by Instituto Superior Técnico Solutions Architect @ Novabase E-mail:

More information

Transactions and Recovery Study Question Solutions

Transactions and Recovery Study Question Solutions 1 1 Questions Transactions and Recovery Study Question Solutions 1. Suppose your database system never STOLE pages e.g., that dirty pages were never written to disk. How would that affect the design of

More information

MySQL Cluster An Introduction

MySQL Cluster An Introduction MySQL Cluster An Introduction Geert Vanderkelen O Reilly MySQL Conference & Expo 2010 Apr. 13 2010 In this presentation we'll introduce you to MySQL Cluster. We ll go through the MySQL server, the storage

More information

Part VII Data Protection

Part VII Data Protection Part VII Data Protection Part VII describes how Oracle protects the data in a database and explains what the database administrator can do to provide additional protection for data. Part VII contains the

More information

Transaction Management Exercises KEY

Transaction Management Exercises KEY Transaction Management Exercises KEY I/O and CPU activities can be and are overlapped to minimize (disk and processor) idle time and to maximize throughput (units of work per time unit). This motivates

More information

Building Better. SQL Server Databases

Building Better. SQL Server Databases Building Better SQL Server Databases Who is this guy? Eric Cobb Started in IT in 1999 as a "webmaster Developer for 14 years Microsoft Certified Solutions Expert (MCSE) Data Platform Data Management and

More information

SQL Server 2014 Training. Prepared By: Qasim Nadeem

SQL Server 2014 Training. Prepared By: Qasim Nadeem SQL Server 2014 Training Prepared By: Qasim Nadeem SQL Server 2014 Module: 1 Architecture &Internals of SQL Server Engine Module : 2 Installing, Upgrading, Configuration, Managing Services and Migration

More information

Document Imaging User Guide

Document Imaging User Guide Release 4.9 IMAGING TECHNOLOGY GROUP Document Imaging Systems Document Imaging User Guide IMAGING TECHNOLOGY GROUP IMIGIT tm Document Imaging User Guide Release 4.91 March 2007 Imaging Technology Group

More information

Lesson 3 Transcript: Part 1 of 2 - Tools & Scripting

Lesson 3 Transcript: Part 1 of 2 - Tools & Scripting Lesson 3 Transcript: Part 1 of 2 - Tools & Scripting Slide 1: Cover Welcome to lesson 3 of the db2 on Campus lecture series. Today we're going to talk about tools and scripting, and this is part 1 of 2

More information

PostgreSQL Performance The basics

PostgreSQL Performance The basics PostgreSQL Performance The basics Joshua D. Drake jd@commandprompt.com Command Prompt, Inc. United States PostgreSQL Software in the Public Interest The dumb simple RAID 1 or 10 (RAID 5 is for chumps)

More information

CHAPTER 3 RECOVERY & CONCURRENCY ADVANCED DATABASE SYSTEMS. Assist. Prof. Dr. Volkan TUNALI

CHAPTER 3 RECOVERY & CONCURRENCY ADVANCED DATABASE SYSTEMS. Assist. Prof. Dr. Volkan TUNALI CHAPTER 3 RECOVERY & CONCURRENCY ADVANCED DATABASE SYSTEMS Assist. Prof. Dr. Volkan TUNALI PART 1 2 RECOVERY Topics 3 Introduction Transactions Transaction Log System Recovery Media Recovery Introduction

More information

DB2 is a complex system, with a major impact upon your processing environment. There are substantial performance and instrumentation changes in

DB2 is a complex system, with a major impact upon your processing environment. There are substantial performance and instrumentation changes in DB2 is a complex system, with a major impact upon your processing environment. There are substantial performance and instrumentation changes in versions 8 and 9. that must be used to measure, evaluate,

More information

Each time a file is opened, assign it one of several access patterns, and use that pattern to derive a buffer management policy.

Each time a file is opened, assign it one of several access patterns, and use that pattern to derive a buffer management policy. LRU? What if a query just does one sequential scan of a file -- then putting it in the cache at all would be pointless. So you should only do LRU if you are going to access a page again, e.g., if it is

More information

What's new in MySQL 5.5? Performance/Scale Unleashed

What's new in MySQL 5.5? Performance/Scale Unleashed What's new in MySQL 5.5? Performance/Scale Unleashed Mikael Ronström Senior MySQL Architect The preceding is intended to outline our general product direction. It is intended for

More information

Table Compression in Oracle9i Release2. An Oracle White Paper May 2002

Table Compression in Oracle9i Release2. An Oracle White Paper May 2002 Table Compression in Oracle9i Release2 An Oracle White Paper May 2002 Table Compression in Oracle9i Release2 Executive Overview...3 Introduction...3 How It works...3 What can be compressed...4 Cost and

More information

Designing a Database -- Understanding Relational Design

Designing a Database -- Understanding Relational Design Designing a Database -- Understanding Relational Design Contents Overview The Database Design Process Steps in Designing a Database Common Design Problems Determining the Purpose Determining the Tables

More information

Persistent Storage - Datastructures and Algorithms

Persistent Storage - Datastructures and Algorithms Persistent Storage - Datastructures and Algorithms 1 / 21 L 03: Virtual Memory and Caches 2 / 21 Questions How to access data, when sequential access is too slow? Direct access (random access) file, how

More information

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 18: Naming, Directories, and File Caching

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 18: Naming, Directories, and File Caching CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring 2004 Lecture 18: Naming, Directories, and File Caching 18.0 Main Points How do users name files? What is a name? Lookup:

More information

Developing SQL Databases (762)

Developing SQL Databases (762) Developing SQL Databases (762) Design and implement database objects Design and implement a relational database schema Design tables and schemas based on business requirements, improve the design of tables

More information

2. PICTURE: Cut and paste from paper

2. PICTURE: Cut and paste from paper File System Layout 1. QUESTION: What were technology trends enabling this? a. CPU speeds getting faster relative to disk i. QUESTION: What is implication? Can do more work per disk block to make good decisions

More information

INSTITUTO SUPERIOR TÉCNICO Administração e optimização de Bases de Dados

INSTITUTO SUPERIOR TÉCNICO Administração e optimização de Bases de Dados -------------------------------------------------------------------------------------------------------------- INSTITUTO SUPERIOR TÉCNICO Administração e optimização de Bases de Dados Exam 1 - solution

More information

Chapter 2. DB2 concepts

Chapter 2. DB2 concepts 4960ch02qxd 10/6/2000 7:20 AM Page 37 DB2 concepts Chapter 2 Structured query language 38 DB2 data structures 40 Enforcing business rules 49 DB2 system structures 52 Application processes and transactions

More information

Announcement. Exercise #2 will be out today. Due date is next Monday

Announcement. Exercise #2 will be out today. Due date is next Monday Announcement Exercise #2 will be out today Due date is next Monday Major OS Developments 2 Evolution of Operating Systems Generations include: Serial Processing Simple Batch Systems Multiprogrammed Batch

More information

Readings and References. Virtual Memory. Virtual Memory. Virtual Memory VPN. Reading. CSE Computer Systems December 5, 2001.

Readings and References. Virtual Memory. Virtual Memory. Virtual Memory VPN. Reading. CSE Computer Systems December 5, 2001. Readings and References Virtual Memory Reading Chapter through.., Operating System Concepts, Silberschatz, Galvin, and Gagne CSE - Computer Systems December, Other References Chapter, Inside Microsoft

More information

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 18: Naming, Directories, and File Caching

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 18: Naming, Directories, and File Caching CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring 2002 Lecture 18: Naming, Directories, and File Caching 18.0 Main Points How do users name files? What is a name? Lookup:

More information

Performance Tuning for MDM Hub for IBM DB2

Performance Tuning for MDM Hub for IBM DB2 Performance Tuning for MDM Hub for IBM DB2 2012 Informatica Corporation. No part of this document may be reproduced or transmitted in any form, by any means (electronic, photocopying, recording or otherwise)

More information

RECOVERY CHAPTER 21,23 (6/E) CHAPTER 17,19 (5/E)

RECOVERY CHAPTER 21,23 (6/E) CHAPTER 17,19 (5/E) RECOVERY CHAPTER 21,23 (6/E) CHAPTER 17,19 (5/E) 2 LECTURE OUTLINE Failures Recoverable schedules Transaction logs Recovery procedure 3 PURPOSE OF DATABASE RECOVERY To bring the database into the most

More information

GFS: The Google File System. Dr. Yingwu Zhu

GFS: The Google File System. Dr. Yingwu Zhu GFS: The Google File System Dr. Yingwu Zhu Motivating Application: Google Crawl the whole web Store it all on one big disk Process users searches on one big CPU More storage, CPU required than one PC can

More information

OLAP Introduction and Overview

OLAP Introduction and Overview 1 CHAPTER 1 OLAP Introduction and Overview What Is OLAP? 1 Data Storage and Access 1 Benefits of OLAP 2 What Is a Cube? 2 Understanding the Cube Structure 3 What Is SAS OLAP Server? 3 About Cube Metadata

More information

Ignite Key-Value Transactions Architecture

Ignite Key-Value Transactions Architecture Ignite Key-Value Transactions Architecture Clustering and Partitioning Transactions Two-Phase Commit Protocol Near Node and Remote Node Locking Modes and Isolation Levels Pessimistic Locking Optimistic

More information

Concurrency Control & Recovery

Concurrency Control & Recovery Transaction Management Overview R & G Chapter 18 There are three side effects of acid. Enchanced long term memory, decreased short term memory, and I forget the third. - Timothy Leary Concurrency Control

More information