DOC PREVIEW
K-State CIS 764 - Study Notes

This preview shows page 1-2-3-26-27-28 out of 28 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

DB PerformanceDatabase PerformanceMy PresentationINDEXINGSlide 5INDEXING: a way of sortingINDEXING Disadvantages (I)INDEXING Disadvantages (II)Slide 9TUNING ORACLEInstallation Rules (I)Installation Rules (II)Installation Rules (III)Memory (I)Memory (II)Memory (III)I/O (I)I/O (II)Oracle Indexing: B-Tree (wiki)I/O (III)I/O (IV)I/O (V)CPU (I)CPU (II)Secrets and Tips (I)Secrets and Tips (II)Secrets and Tips (III)ReferencesDB PerformanceAna StanescuCIS764 - Fall 08KSU2Database PerformanceWhy does this topic fit in 764?Why is this an issue in the industry?Advantages overweigh drawbacksNeed for better response from the dbEfficient use of resourcesExperience and knowledge to do it correctly3My PresentationDB performanceIndexingTuning OracleInstallationMemoryI/OCPUSecrets and Tips4INDEXINGA means of increasing database performance of queriesConceptually similar to book indexingSpeed of operations is increasedData retrieval done better & fasterShortcut for the DB to find the records that match some search criteria5INDEXINGData is stored in blocksAtomic disk operations to access themSearch problemRecords can be sorted on just one fieldIf the records are not sorted, a linear search requires N/2 block accessesIf field is a non-key (not unique), the entire table space is searched at N block accesses6INDEXING: a way of sortingSolutionIndexing permits the sorting of data on multiple fieldsLog N block accesses (Binary Search)Once a higher value is found, the rest needs not be searchedCreating an index on a field in a table creates another data structure which contains:Value of the fieldPointer to the corresponding recordThis index structure is then sortedAllows Binary Search to be performed on it7INDEXING Disadvantages (I)The index structures occupy disk spaceCorrect selection of fields to indexFile systems size limits the number of indexes to be createdxample: 5M records, block size 1MB, record length of 54bneed of almost 300,000 blocks  approx 19 block accesses to find a record8INDEXING Disadvantages (II)Indexes have to be updated when the corresponding data is changed For static databases where heavy reporting is needed, more indexes are required to support the read-only queriesFor systems with numerous transactions that modify the data, fewer indexes provide higher data rates delivered9INDEXINGHeuristicsShort index (lower disk work intensity)Columns targeted for indexing must have high selectivity (cardinality/#rows*Cardinality = uniqueness of data in a columnSmall percentage of duplicated valuesCovering queries (composite index - using more than one column) Careful analysis, benchmarking, and testing10TUNING ORACLEDBA responsible for optimizing the performance of Oracle softwarealso application developershardware experts30% of SDLC dedicated to performance issuesConstant monitoringThird-party monitoring product11Installation Rules (I)Readme file up-to-date infoEnough disk space up frontAllocate an extra of 20% for the installation process (requirements are lower than what is optimal)O/S Level PrivilegesDBA overly rich in privilegesOracle must own its directory structure12Installation Rules (II)SHARED_POOL_SIZE set to tw ice the suggested defaultFile StructureRecommended not to merge multiple physical drives into one large logical driveAllocate an entire device to hold Oracle data files (no partitioning)One directory point should point to one physical deviceLay out large tablespaces into small manageable sections (limits imposed by backup devices and O/S)13Installation Rules (III)DB creation issuesMaxdatafiles set as highly as the O/S permitsRedo Logs must be mirrored, as they are a single point of failureMinimal tablespace configuration: SYSTEM, ROLLBACK, TEMP, TOOLS, USERS* (small by default, ability to pre-allocate upfront if more space needed)Control files (recovery info and integrity maintenance) – min of 3 CF on different disk drives14Memory (I)Maximize the requests satisfied in memory vs. performing I/O opsHits vs. misses - DB buffer cachequery $kcbrbh table shows the effect of adding buffers:500 buffers -> 1200 hits 1500 buffers -> 6700 hitsBackground processes to support DB activityPMON – process recovery SMON – instance recoveryDBRW – writes info from buffers to dbLGWR – info from redo log buffer to online redo logsCKPT – responsible for header updates (takes work away from LGWR) set to true if more than 20 db filesARCH – copies redo logsTrace Files (info about user sessions)Memory (II)SGA (system global area) Data and control info particular to an Oracle instance# of buffers dedicated to the cache# of bytes allocated to the shared SQL area How much memory is enough?O/S, buffers, coexisting software, Oracle db, etc Roughly 3 times that calculated for the support of the Oracle systemsShared pool (library & dictionary)v$ibrarycache dictionary (sql statements) info pertaining to segments (indexes, tables)15Memory (III)Multithreaded ServerServer work is done on behalf of the user by a dedicated process (shadow)Pool of server processes to be shared by users for Edited in the MTS Initialization Parameter Filemain memory conservation SORT_AREA_SIZE parameter allocation of chunks of memory for sorting activities512K (10g) default, DBA can increase it though if more than 25% of sort requests require disk space (using v$sysstat), increase is necessary16I/O (I)Separate tablespaces for heavily accessed tables and their indexes and place them on separate disksKnowing how data is to be accessed by end usersRollback segmentsMust store enough informationInfo about concurrent actionsRollback segments must not be used in the system tablespace (b/c of extension needs)Allocate at least one tablespace exclusively used for temporary segments17I/O (II)Redo logs must reside on a disk that has a low rate of reads and writes“Hot Spots” – files within Oracle db that are most heavily read or written toCommand monitor fileio to see the content of the pool Make sure they are on separate disks18Oracle Indexing: B-Tree (wiki)19I/O (III)TheSroot node contains node pointers to intermediate nodes Branch nodeScontains pointers to other


View Full Document

K-State CIS 764 - Study Notes

Documents in this Course
Load more
Download Study Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Study Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Study Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?