dbms 3 sem
DESCRIPTION
TRANSCRIPT
![Page 1: Dbms 3 sem](https://reader035.vdocument.in/reader035/viewer/2022081413/5479788e5806b599048b46f8/html5/thumbnails/1.jpg)
Prepared by: Anusha Adhikar BBA Sem 3
Prepared by: Anusha Adhikar BBA Sem 3
AMITY GLOBAL BUSINESS SCHOOL
![Page 2: Dbms 3 sem](https://reader035.vdocument.in/reader035/viewer/2022081413/5479788e5806b599048b46f8/html5/thumbnails/2.jpg)
2
Goal of database performance is to execute queries as fast as possible
Database performance tuningSet of activities and procedures designed to
reduce response time of database system
![Page 3: Dbms 3 sem](https://reader035.vdocument.in/reader035/viewer/2022081413/5479788e5806b599048b46f8/html5/thumbnails/3.jpg)
3
Database performance-tuning activities can be divided into:Client side
Objective is to generate SQL query that returns correct answer in least amount of time, using minimum amount of resources at server end
SQL performance tuning
![Page 4: Dbms 3 sem](https://reader035.vdocument.in/reader035/viewer/2022081413/5479788e5806b599048b46f8/html5/thumbnails/4.jpg)
4
Database performance-tuning activities can be divided into (continued):Server side
DBMS environment must be properly configured to respond to clients’ requests in fastest way possible, while making optimum use of existing resources
DBMS performance tuning
![Page 5: Dbms 3 sem](https://reader035.vdocument.in/reader035/viewer/2022081413/5479788e5806b599048b46f8/html5/thumbnails/5.jpg)
5
All data in database are stored in data files
Data filesAutomatically expand in predefined
increments known as extendsGenerally grouped in file groups of table
spaces Table space or file group is logical
grouping of several data files that store data with similar characteristics
![Page 6: Dbms 3 sem](https://reader035.vdocument.in/reader035/viewer/2022081413/5479788e5806b599048b46f8/html5/thumbnails/6.jpg)
6
DBMS retrieve data from permanent storage and place it in RAM
Data cache or buffer cache is shared, reserved memory area that stores most recently accessed data blocks in RAM
SQL cache or procedure cache is shared, reserved memory area that stores most recently executed SQL statements or PL/SQL procedures, including triggers and functions
![Page 7: Dbms 3 sem](https://reader035.vdocument.in/reader035/viewer/2022081413/5479788e5806b599048b46f8/html5/thumbnails/7.jpg)
7
An input/output request is low-level (read or write) data access operation to/from computer devices
Working with data in data cache is many times faster than working with data in data files because DBMS doesn’t have to wait for hard disk to retrieve data
Majority of performance-tuning activities focus on minimizing number of I/O operations
![Page 8: Dbms 3 sem](https://reader035.vdocument.in/reader035/viewer/2022081413/5479788e5806b599048b46f8/html5/thumbnails/8.jpg)
8
Listener User Scheduler Lock manager Optimizer
![Page 9: Dbms 3 sem](https://reader035.vdocument.in/reader035/viewer/2022081413/5479788e5806b599048b46f8/html5/thumbnails/9.jpg)
9
Refers to number of measurements about database objects and available resourcesTables IndexesNumber of processors usedProcessor speedTemporary space available
![Page 10: Dbms 3 sem](https://reader035.vdocument.in/reader035/viewer/2022081413/5479788e5806b599048b46f8/html5/thumbnails/10.jpg)
10
Make critical decisions about improving query processing efficiency
Can be gathered manually by DBA or automatically by DBMS
![Page 11: Dbms 3 sem](https://reader035.vdocument.in/reader035/viewer/2022081413/5479788e5806b599048b46f8/html5/thumbnails/11.jpg)
11
DBMS processes queries in three phasesParsingExecutionFetching
![Page 12: Dbms 3 sem](https://reader035.vdocument.in/reader035/viewer/2022081413/5479788e5806b599048b46f8/html5/thumbnails/12.jpg)
12
![Page 13: Dbms 3 sem](https://reader035.vdocument.in/reader035/viewer/2022081413/5479788e5806b599048b46f8/html5/thumbnails/13.jpg)
13
Query optimizer analyzes SQL query and finds most efficient way to access data
Access plans are DBMS-specific and translate client’s SQL query into series of complex I/O operations required to read the data from the physical data files and generate result set
![Page 14: Dbms 3 sem](https://reader035.vdocument.in/reader035/viewer/2022081413/5479788e5806b599048b46f8/html5/thumbnails/14.jpg)
14
Rows of resulting query result set are returned to client
DBMS may use temporary table space to store temporary data
![Page 15: Dbms 3 sem](https://reader035.vdocument.in/reader035/viewer/2022081413/5479788e5806b599048b46f8/html5/thumbnails/15.jpg)
15
IndexesCrucial in speeding up data accessFacilitate searching, sorting, and using
aggregate functions as well as join operations
Ordered set of values that contains index key and pointers
More efficient to use index to access table than to scan all rows in table sequentially
![Page 16: Dbms 3 sem](https://reader035.vdocument.in/reader035/viewer/2022081413/5479788e5806b599048b46f8/html5/thumbnails/16.jpg)
16
Rule-based optimizerUses set of preset rules and points to
determine best approach to execute query Cost-based optimizer
Uses sophisticated algorithms based on statistics about objects being accessed to determine best approach to execute query
![Page 17: Dbms 3 sem](https://reader035.vdocument.in/reader035/viewer/2022081413/5479788e5806b599048b46f8/html5/thumbnails/17.jpg)
17
Evaluated from client perspectiveMost current-generation relational DBMSs
perform automatic query optimization at the server end
Most SQL performance optimization techniques are DBMS-specific and are rarely portable
![Page 18: Dbms 3 sem](https://reader035.vdocument.in/reader035/viewer/2022081413/5479788e5806b599048b46f8/html5/thumbnails/18.jpg)
18
Indexes are likely used when: Indexed column appears by itself in search
criteria of WHERE or HAVING clause Indexed column appears by itself in GROUP
BY or ORDER BY clauseMAX or MIN function is applied to indexed
columnData sparsity on indexed column is high
Measure of how likely an index will be used
![Page 19: Dbms 3 sem](https://reader035.vdocument.in/reader035/viewer/2022081413/5479788e5806b599048b46f8/html5/thumbnails/19.jpg)
19
General guidelines for creating and using indexes:Create indexes for each attribute in WHERE,
HAVING, ORDER BY, or GROUP BY clauseDo not use in small tables or tables with low
sparsityDeclare primary and foreign keys so optimizer
can use indexes in join operationsDeclare indexes in join columns other than
PK/FK
![Page 20: Dbms 3 sem](https://reader035.vdocument.in/reader035/viewer/2022081413/5479788e5806b599048b46f8/html5/thumbnails/20.jpg)
20
Normally expressed within WHERE or HAVING clauses of SQL statement
Restricts output of query to only rows matching conditional criteria
![Page 21: Dbms 3 sem](https://reader035.vdocument.in/reader035/viewer/2022081413/5479788e5806b599048b46f8/html5/thumbnails/21.jpg)
21
![Page 22: Dbms 3 sem](https://reader035.vdocument.in/reader035/viewer/2022081413/5479788e5806b599048b46f8/html5/thumbnails/22.jpg)
22
Identify what columns and computations are required
Identify source tables Determine how to join tables Determine what selection criteria is
needed Determine in what order to display
output
![Page 23: Dbms 3 sem](https://reader035.vdocument.in/reader035/viewer/2022081413/5479788e5806b599048b46f8/html5/thumbnails/23.jpg)
23
Includes global tasks such as managing DBMS processes in primary memory and structures in physical storage
Includes applying several practices examined in previous section
![Page 24: Dbms 3 sem](https://reader035.vdocument.in/reader035/viewer/2022081413/5479788e5806b599048b46f8/html5/thumbnails/24.jpg)
24
DBMS performance tuning at server end focuses on setting parameters used for:Data cacheSQL cacheSort cacheOptimizer mode
![Page 25: Dbms 3 sem](https://reader035.vdocument.in/reader035/viewer/2022081413/5479788e5806b599048b46f8/html5/thumbnails/25.jpg)
25
Some general recommendations for creation of databases:Use RAID (Redundant Array of Independent
Disks) to provide balance between performance and fault tolerance
Minimize disk contentionPut high-usage tables in their own table
spaces
![Page 26: Dbms 3 sem](https://reader035.vdocument.in/reader035/viewer/2022081413/5479788e5806b599048b46f8/html5/thumbnails/26.jpg)
26
Some general recommendations for creation of databases (continued):Assign separate data files in separate
storage volumes for indexes, system, and high-usage tables
Partition tables based on usageUse denormalized tables where appropriateStore computed and aggregate attributes in
tables
![Page 27: Dbms 3 sem](https://reader035.vdocument.in/reader035/viewer/2022081413/5479788e5806b599048b46f8/html5/thumbnails/27.jpg)
27