Database Performance Tuning and Query Optimization (a) Week 3 1 (MO2, Chapter 11-1 to 11-2) Flashcards
Database Performance-Tuning
Concepts, and sequence.
One of the main functions of a database system is to provide
timely answers.
* End users interact with the DBMS through the use of queries to
generate information, using the following sequence:
1. End-user (client-end) application generates a query
2. Query is sent to the DBMS (server end)
3. DBMS (server end) executes the query
4. DBMS sends the resulting data set to the end-user
(client-end) application
Database performance tuning concepts
- Goal of database performance is to execute queries as fast as
possible - Database performance tuning: set of activities and procedures that
reduce response time of database system - Fine-tuning the performance of a system requires a holistic
approach - All factors must operate at optimum level with minimal bottlenecks
Performance tuning: Client and Server.
Client side: SQL performance tuning
* Generate SQL query that returns correct answer in least amount of
time
* Using minimum amount of resources at server
* Server side: DBMS performance tuning
* DBMS environment is configured to respond to clients’ requests as fast
as possible
* While making optimum use of existing resour
DBMS Architecture
Data files
All data is a database is stored in datafiles
Extends
IN DBMS Enviroment refers to the ability of data files to expand in size automatically using predefined increments
Table space or file group:
logical storage place used to group related data
Data cache or buffer cache
shared, reserved memory area that stores the most recently accessed data blocks in RAM
SQL cache or procedure cache
is a shared, resereved memory area that stores the most recently executed SQL statements
An input output request
Low level data access operation that reads or writes data to and from computer devices
Database query optimization modes, what are the two principles of the algorithms proposed for query optimization
- Optimum order to achieve the fastest execution time
- Sites to be accessed to minimize communication costs
What is the evaluation based on?
- Evaluated based on:
- Operation mode
- Timing of its optimization
What are the two ways optimization modes can be classified into?
Automatic query optimization: Query finds most cost efective path without user intervention
Manual query optimization: Requires optimization to be selected and scheduled by the end user.
Classification based on timing of optimization?
Static query optimization: best optimization strategy is selected when
the query is compiled by the DBMS
* Takes place at compilation time
* Dynamic query optimization: access strategy is dynamically
determined by the DBMS at run time, using the most up-to-date
information about the database
* Takes place at execution time
Classification based on type of information used to optimize the
query
Statistically based query optimization algorithm: statistics are used by
the DBMS to determine the best access strategy
* Statistical information is generated by DBMS through:
* Dynamic statistical generation mode
* Manual statistical generation mode
* Rule-based query optimization algorithm: based on a set of
user-defined rules to determine the best query access strategy