Database performance tuning involves activities to ensure queries are processed in the minimum amount of time. A DBMS processes queries in three phases - parsing, execution, and fetching. Indexes are crucial for speeding up data access by facilitating operations like searching and sorting. Query optimization involves the DBMS choosing the most efficient plan for accessing data, such as which indexes to use.
Optimizing Query is very important to improve the performance of the database. Analyse query using query execution plan, create cluster index and non-cluster index and create indexed views
This session is for you if you want to learn tips and techniques that are used to optimize database development with special emphasis on SQL Server 2005. If you write lot of stored procedures and want to learn the tools of a DBA, this is the session for you. If you are new to SQL Server development environment, you will learn how the various constructs compare to each other and better performance can be produced every time with a brief introduction to understanding Execution Plans.
Optimizing Query is very important to improve the performance of the database. Analyse query using query execution plan, create cluster index and non-cluster index and create indexed views
This session is for you if you want to learn tips and techniques that are used to optimize database development with special emphasis on SQL Server 2005. If you write lot of stored procedures and want to learn the tools of a DBA, this is the session for you. If you are new to SQL Server development environment, you will learn how the various constructs compare to each other and better performance can be produced every time with a brief introduction to understanding Execution Plans.
This ppt helps people who would like to present their industrial training presentation on Oracle 11g DBA.
This one includes all the operations that dba has to be perform and some other internal concepts of Oracle.
SQL Server Tuning to Improve Database PerformanceMark Ginnebaugh
SQL Server tuning is a process to eliminate performance bottlenecks and improve application service. This presentation from Confio Software discusses SQL diagramming, wait type data, column selectivity, and other solutions that will help make tuning projects a success, including:
•SQL Tuning Methodology
•Response Time Tuning Practices
•How to use SQL Diagramming techniques to tune SQL statements
•How to read executions plans
This presentation explains the major differences between SQL and NoSQL databases in terms of Scalability, Flexibility and Performance. It also talks about MongoDB which is a document-based NoSQL database and explains the database strutre for my mouse-human research classifier project.
Relational databases vs Non-relational databasesJames Serra
There is a lot of confusion about the place and purpose of the many recent non-relational database solutions ("NoSQL databases") compared to the relational database solutions that have been around for so many years. In this presentation I will first clarify what exactly these database solutions are, compare them, and discuss the best use cases for each. I'll discuss topics involving OLTP, scaling, data warehousing, polyglot persistence, and the CAP theorem. We will even touch on a new type of database solution called NewSQL. If you are building a new solution it is important to understand all your options so you take the right path to success.
This ppt helps people who would like to present their industrial training presentation on Oracle 11g DBA.
This one includes all the operations that dba has to be perform and some other internal concepts of Oracle.
SQL Server Tuning to Improve Database PerformanceMark Ginnebaugh
SQL Server tuning is a process to eliminate performance bottlenecks and improve application service. This presentation from Confio Software discusses SQL diagramming, wait type data, column selectivity, and other solutions that will help make tuning projects a success, including:
•SQL Tuning Methodology
•Response Time Tuning Practices
•How to use SQL Diagramming techniques to tune SQL statements
•How to read executions plans
This presentation explains the major differences between SQL and NoSQL databases in terms of Scalability, Flexibility and Performance. It also talks about MongoDB which is a document-based NoSQL database and explains the database strutre for my mouse-human research classifier project.
Relational databases vs Non-relational databasesJames Serra
There is a lot of confusion about the place and purpose of the many recent non-relational database solutions ("NoSQL databases") compared to the relational database solutions that have been around for so many years. In this presentation I will first clarify what exactly these database solutions are, compare them, and discuss the best use cases for each. I'll discuss topics involving OLTP, scaling, data warehousing, polyglot persistence, and the CAP theorem. We will even touch on a new type of database solution called NewSQL. If you are building a new solution it is important to understand all your options so you take the right path to success.
SQL (Structured Query language) is a standard language for the database access and their management according to American National Standards Institute.
(by QATestLab)
Protect and maintain databases
حماية و صيانة قواعد البيانات
1. ضغط و اصلاح قاعدة البيانات تساعدنا في تحسين أداء قاعدة البيانات و اصلاح الملف عند حدوث المشاكل.
2. تشفير قاعدة البيانات بتطبيق كلمة مرور لتقييد الوصول, فقط المستخدمون الذين يعرفون كلمة المرور يستطيعون الوصول الى قاعدة البيانات.
3. العمل مع النسخ الاحتياطي.
4. دمج قواعد البيانات.
5. تقسيم قاعدة البيانات و هي خطوة تطبق خصيصا للمشاركة مع عدة مستخدمين.
إدارة السجلات
يمكنك إدارة السجلات في الجداول من خلال عرض ورقة البيانات. يشرح هذا القسم كيفية إضافة, تحديث, و حذف السجلات,
و أيضا كيفية البحث, الفرز, و تصفية السجلات عندما تحتاج الى العمل مع السجلات التي تناسب معايير مخصصة.
يشرح هذا القسم أيضا كيفية إلحاق سجلات الى جدول موجود.
Database Systems Design, Implementation, and ManagementOllieShoresna
Database Systems: Design,
Implementation, and
Management
Eighth Edition
Chapter 11
Database Performance Tuning and
Query Optimization
Database Systems, 8th Edition 2
Objectives
• In this chapter, you will learn:
– Basic database performance-tuning concepts
– How a DBMS processes SQL queries
– About the importance of indexes in query processing
– About the types of decisions the query optimizer has
to make
– Some common practices used to write efficient SQL
code
– How to formulate queries and tune the DBMS for
optimal performance
– Performance tuning in SQL Server 2005
Database Systems, 8th Edition 3
11.1 Database Performance-Tuning Concepts
• Goal of database performance is to execute
queries as fast as possible
• Database performance tuning
– Set of activities and procedures designed to
reduce response time of database system
• All factors must operate at optimum level with
minimal bottlenecks
• Good database performance starts with
good database design
Database Systems, 8th Edition 4
Database Systems, 8th Edition 5
Performance Tuning: Client and Server
• Client side
– Generate SQL query that returns correct answer
in least amount of time
• Using minimum amount of resources at server
– SQL performance tuning
• Server side
– DBMS environment configured to respond to
clients’ requests as fast as possible
• Optimum use of existing resources
– DBMS performance tuning
Database Systems, 8th Edition 6
DBMS Architecture
• All data in database are stored in data files
• Data files
– Automatically expand in predefined increments
known as extends
– Grouped in file groups or table spaces
• Table space or file group:
– Logical grouping of several data files that store
data with similar characteristics
Database Systems, 8th Edition 7
Basic DBMS architecture
Database Systems, 8th Edition 8
DBMS Architecture (continued)
• Data cache or buffer cache: shared, reserved
memory area
– Stores most recently accessed data blocks in RAM
• SQL cache or procedure cache: stores most
recently executed SQL statements
– Also PL/SQL procedures, including triggers and
functions
• DBMS retrieves data from permanent storage and
places it in RAM
Database Systems, 8th Edition 9
DBMS Architecture (continued)
• Input/output request: low-level data access
operation to/from computer devices, such as
memory, hard disks, videos, and printers
• Data cache is faster than data in data files
– DBMS does not wait for hard disk to retrieve data
• Majority of performance-tuning activities focus on
minimizing I/O operations
• Typical DBMS processes:
– Listener, User, Scheduler, Lock manager, Optimizer
Database Systems, 8th Edition 10
Database Statistics
• Measurements about database objects and available
resources
– Tables, Indexes, Number of processors used,
Processor speed, Temporary space available
• Make critical decisions about improving query
processing efficiency
• Can be gathered manually by ...
Antes de migrar de 10g a 11g o 12c, tome en cuenta las siguientes consideraciones. No es tan sencillo como simplemente cambiar de motor de base de datos, se necesita hacer consideraciones a nivel del aplicativo.
Java Developers, make the database work for you (NLJUG JFall 2010)Lucas Jellema
The general consensus among Java developers has evolved from a dogmatic strive for database independence to a much more pragmatic wish to leverage the power of the database. This session demonstrates some of the (hidden) powers of the database and how these can be utilized from Java applications using either straight JDBC or working through JPA. The Oracle database is used as example: SQL for Aggregation and Analysis, Flashback Queries for historical comparison and trends, Virtual Private Database, complex validation, PL/SQL and collections for bulk data manipulation, view and instead-of triggers for data model morphing, server push of relevant data changes, edition based redefinition for release management.
- overview of role of database in JEE architecture (and a little history on how the database is perceived through the years)
- discussion on the development of database functionality
- demonstration of some powerful database features
- description of how we leveraged these features in our JSF (RichFaces)/JPA (Hibernate) application
- demo of web application based on these features
- discussion on how to approach the database
Geek Sync I Need for Speed: In-Memory Databases in Oracle and SQL ServerIDERA Software
You can watch the replay for this Geek Sync webcast in the IDERA Resource Center: http://ow.ly/S6MG50A5ok5
Microsoft introduced IN-MEMORY OLTP, widely referred to as “Hekaton” in SQL Server 2014. Hekaton allows for the creation of fully transactionally consistent memory-resident tables designed for high concurrency and no blocking. With SQL 2016, many of the original restrictions and limitations of this feature have been reduced. IDERA’s Vicky Harp will give an overview of this feature, including how to compile T-SQL code into machine code for an even greater performance boost.
There’s also been a lot of buzz about Oracle 12c’s new IN-MEMORY COLUMN STORE. Oracle ACE Bert Scalzo will cover this new feature, how it works, it’s benefits, scripts to measure/monitor it and more. He will also touch on performance observations from benchmarking this new feature against more traditional SGA memory allocations plus Oracle 11g R2’s Database Smart Flash Cache. All findings, scripts and conclusions from this exercise will be shared. In addition, two very popular database benchmarking tools will be highlighted.
Take an in-depth look at data warehousing with Amazon Redshift and get answers to your technical questions. We will cover performance tuning techniques that take advantage of Amazon Redshift's columnar technology and massively parallel processing architecture. We will also discuss best practices for migrating from existing data warehouses, optimizing your schema, loading data efficiently, and using work load management and interleaved sorting.
Techniques to optimize the pagerank algorithm usually fall in two categories. One is to try reducing the work per iteration, and the other is to try reducing the number of iterations. These goals are often at odds with one another. Skipping computation on vertices which have already converged has the potential to save iteration time. Skipping in-identical vertices, with the same in-links, helps reduce duplicate computations and thus could help reduce iteration time. Road networks often have chains which can be short-circuited before pagerank computation to improve performance. Final ranks of chain nodes can be easily calculated. This could reduce both the iteration time, and the number of iterations. If a graph has no dangling nodes, pagerank of each strongly connected component can be computed in topological order. This could help reduce the iteration time, no. of iterations, and also enable multi-iteration concurrency in pagerank computation. The combination of all of the above methods is the STICD algorithm. [sticd] For dynamic graphs, unchanged components whose ranks are unaffected can be skipped altogether.
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...Subhajit Sahu
Abstract — Levelwise PageRank is an alternative method of PageRank computation which decomposes the input graph into a directed acyclic block-graph of strongly connected components, and processes them in topological order, one level at a time. This enables calculation for ranks in a distributed fashion without per-iteration communication, unlike the standard method where all vertices are processed in each iteration. It however comes with a precondition of the absence of dead ends in the input graph. Here, the native non-distributed performance of Levelwise PageRank was compared against Monolithic PageRank on a CPU as well as a GPU. To ensure a fair comparison, Monolithic PageRank was also performed on a graph where vertices were split by components. Results indicate that Levelwise PageRank is about as fast as Monolithic PageRank on the CPU, but quite a bit slower on the GPU. Slowdown on the GPU is likely caused by a large submission of small workloads, and expected to be non-issue when the computation is performed on massive graphs.
2. Database Systems, 8th
Edition 2
Objectives
• In this chapter, you will learn:
– Basic database performance-tuning concepts
– How a DBMS processes SQL queries
– About the importance of indexes in query
processing
3. Database Systems, 8th
Edition 3
Objectives (continued)
• In this chapter, you will learn: (continued)
– About the types of decisions the query optimizer
has to make
– Some common practices used to write efficient
SQL code
– How to formulate queries and tune the DBMS for
optimal performance
4. Database Systems, 8th
Edition 4
Database Performance-Tuning
Concepts
• Goal of database performance is to execute
queries as fast as possible
• Database performance tuning
– Set of activities and procedures designed to
reduce response time of database system
• All factors must operate at optimum level with
minimal bottlenecks
• Good database performance starts with
good database design
6. Database Systems, 8th
Edition 6
Performance Tuning:
Client and Server
• Client side
– Generate SQL query that returns correct answer
in least amount of time
• Using minimum amount of resources at server
– SQL performance tuning
• Server side
– DBMS environment configured to respond to
clients’ requests as fast as possible
• Optimum use of existing resources
– DBMS performance tuning
7. Database Systems, 8th
Edition 7
DBMS Architecture
• All data in database are stored in data files
• Data files
– Automatically expand in predefined increments
known as extends
– Grouped in file groups or table spaces
• Table space or file group:
– Logical grouping of several data files that store
data with similar characteristics
9. Database Systems, 8th
Edition 9
DBMS Architecture (continued)
• Data cache or buffer cache: shared, reserved
memory area
– Stores most recently accessed data blocks in
RAM
• SQL cache or procedure cache: stores most
recently executed SQL statements
– Also PL/SQL procedures, including triggers and
functions
• DBMS retrieves data from permanent storage
and places it in RAM
10. Database Systems, 8th
Edition 10
DBMS Architecture (continued)
• Input/output request: low-level data access
operation to/from computer devices
• Data cache is faster than data in data files
– DBMS does not wait for hard disk to retrieve data
• Majority of performance-tuning activities focus on
minimizing I/O operations
• Typical DBMS processes:
– Listener, User, Scheduler, Lock manager, Optimizer
11. Database Systems, 8th
Edition 11
Database Statistics
• Measurements about database objects and
available resources
– Tables
– Indexes
– Number of processors used
– Processor speed
– Temporary space available
12. Database Systems, 8th
Edition 12
Database Statistics (continued)
• Make critical decisions about improving query
processing efficiency
• Can be gathered manually by DBA or
automatically by DBMS
14. Database Systems, 8th
Edition 14
Query Processing
• DBMS processes queries in three phases
– Parsing
• DBMS parses the query and chooses the most
efficient access/execution plan
– Execution
• DBMS executes the query using chosen
execution plan
– Fetching
• DBMS fetches the data and sends the result back
to the client
16. Database Systems, 8th
Edition 16
SQL Parsing Phase
• Break down query into smaller units
• Transform original SQL query into slightly
different version of original SQL code
– Fully equivalent
• Optimized query results are always the same as
original query
– More efficient
• Optimized query will almost always execute faster
than original query
17. Database Systems, 8th
Edition 17
SQL Parsing Phase (continued)
• Query optimizer analyzes SQL query and finds
most efficient way to access data
– Validated for syntax compliance
– Validated against data dictionary
• Tables, column names are correct
• User has proper access rights
– Analyzed and decomposed into components
– Optimized
– Prepared for execution
18. Database Systems, 8th
Edition 18
SQL Parsing Phase (continued)
• Access plans are DBMS-specific
– 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
• DBMS checks if access plan already exists for
query in SQL cache
• DBMS reuses the access plan to save time
• If not, optimizer evaluates various plans
– Chosen plan placed in SQL cache
20. Database Systems, 8th
Edition 20
SQL Execution Phase
SQL Fetching Phase
• All I/O operations indicated in access plan are
executed
– Locks acquired
– Data retrieved and placed in data cache
– Transaction management commands processed
• Rows of resulting query result set are returned
to client
• DBMS may use temporary table space to store
temporary data
21. Database Systems, 8th
Edition 21
Query Processing Bottlenecks
• Delay introduced in the processing of an I/O
operation that slows the system
– CPU
– RAM
– Hard disk
– Network
– Application code
22. Database Systems, 8th
Edition 22
Indexes and Query Optimization
• Indexes
– Crucial in speeding up data access
– Facilitate 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
23. Database Systems, 8th
Edition 23
Indexes and Query Optimization
(continued)
• Data sparsity: number of different values a
column could possibly have
• Indexes implemented using:
– Hash indexes
– B-tree indexes
– Bitmap indexes
• DBMSs determine best type of index to use
25. Database Systems, 8th
Edition 25
Optimizer Choices
• Rule-based optimizer
– Preset rules and points
– Rules assign a fixed cost to each operation
• Cost-based optimizer
– Algorithms based on statistics about objects
being accessed
– Adds up processing cost, I/O costs, resource
costs to derive total cost
27. Database Systems, 8th
Edition 27
Using Hints to Affect
Optimizer Choices
• Optimizer might not choose best plan
• Makes decisions based on existing statistics
– Statistics may be old
– Might choose less efficient decisions
• Optimizer hints: special instructions for the
optimizer embedded in the SQL command text
29. Database Systems, 8th
Edition 29
SQL Performance Tuning
• Evaluated from client perspective
– Most current relational DBMSs perform
automatic query optimization at the server end
– Most SQL performance optimization techniques
are DBMS-specific
• Rarely portable
• Majority of performance problems related to
poorly written SQL code
• Carefully written query usually outperforms a
poorly written query
30. Database Systems, 8th
Edition 30
Index Selectivity
• Indexes are 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 clause
– MAX or MIN function is applied to indexed
column
– Data sparsity on indexed column is high
• Measure of how likely an index will be used
31. Database Systems, 8th
Edition 31
Index Selectivity (continued)
• General guidelines for indexes:
– Create indexes for each attribute in WHERE,
HAVING, ORDER BY, or GROUP BY clause
– Do not use in small tables or tables with low
sparsity
– Declare primary and foreign keys so optimizer
can use indexes in join operations
– Declare indexes in join columns other than
PK/FK
32. Database Systems, 8th
Edition 32
Conditional Expressions
• Normally expressed within WHERE or HAVING
clauses of SQL statement
• Restricts output of query to only rows matching
conditional criteria
33. Database Systems, 8th
Edition 33
Conditional Expressions (continued)
• Common practices for efficient SQL:
– Use simple columns or literals in conditionals
– Numeric field comparisons are faster
– Equality comparisons faster than inequality
– Transform conditional expressions to use literals
– Write equality conditions first
– AND: Use condition most likely to be false first
– OR: Use condition most likely to be true first
– Avoid NOT
34. Database Systems, 8th
Edition 34
Query Formulation
• 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
35. Database Systems, 8th
Edition 35
DBMS Performance Tuning
• Includes managing DBMS processes in primary
memory and structures in physical storage
• DBMS performance tuning at server end
focuses on setting parameters used for:
– Data cache
– SQL cache
– Sort cache
– Optimizer mode
36. Database Systems, 8th
Edition 36
DBMS Performance Tuning
(continued)
• Some general recommendations for creation of
databases:
– Use RAID (Redundant Array of Independent
Disks) to provide balance between performance
and fault tolerance
– Minimize disk contention
– Put high-usage tables in their own table spaces
– Assign separate data files in separate storage
volumes for indexes, system, high-usage tables
37. Database Systems, 8th
Edition 37
DBMS Performance Tuning
(continued)
• Some general recommendations for creation of
databases: (continued)
– Take advantage of table storage organizations
in database
– Partition tables based on usage
– Use denormalized tables where appropriate
– Store computed and aggregate attributes in
tables
38. Database Systems, 8th
Edition 38
Query Optimization Example
• Example illustrates how query optimizer works
• Based on QOVENDOR and QOPRODUCT
tables
• Uses Oracle SQL*Plus
48. Database Systems, 8th
Edition 48
Summary
• Database performance tuning
– Refers to activities to ensure query is processed
in minimum amount of time
• SQL performance tuning
– Refers to activities on client side to generate
SQL code
• Returns correct answer in least amount of time
• Uses minimum amount of resources at server
end
• DBMS architecture represented by processes
and structures used to manage a database
49. Database Systems, 8th
Edition 49
Summary (continued)
• Database statistics refers to measurements
gathered by the DBMS
– Describe snapshot of database objects’
characteristics
• DBMS processes queries in three phases:
parsing, execution, and fetching
• Indexes are crucial in process that speeds up
data access
50. Database Systems, 8th
Edition 50
Summary (continued)
• During query optimization, DBMS chooses:
– Indexes to use, how to perform join operations,
table to use first, etc.
• Hints change optimizer mode for current SQL
statement
• SQL performance tuning deals with writing
queries that make good use of statistics
• Query formulation deals with translating
business questions into specific SQL code