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.
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
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 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.
What to Expect From Oracle database 19cMaria Colgan
The Oracle Database has recently switched to an annual release model. Oracle Database 19c is only the second release in this new model. So what can you expect from the latest version of the Oracle Database? This presentation explains how Oracle Database 19c is really 12.2.0.3 the terminal release of the 12.2 family and the new features you can find in this release.
“not only SQL.”
NoSQL databases are databases store data in a format other than relational tables.
NoSQL databases or non-relational databases don’t store relationship data well.
Any DBA from beginner to advanced level, who wants to fill in some gaps in his/her knowledge about Performance Tuning on an Oracle Database, will benefit from this workshop.
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 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.
What to Expect From Oracle database 19cMaria Colgan
The Oracle Database has recently switched to an annual release model. Oracle Database 19c is only the second release in this new model. So what can you expect from the latest version of the Oracle Database? This presentation explains how Oracle Database 19c is really 12.2.0.3 the terminal release of the 12.2 family and the new features you can find in this release.
“not only SQL.”
NoSQL databases are databases store data in a format other than relational tables.
NoSQL databases or non-relational databases don’t store relationship data well.
Any DBA from beginner to advanced level, who wants to fill in some gaps in his/her knowledge about Performance Tuning on an Oracle Database, will benefit from this workshop.
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.
This presentation features the fundamentals of SQL tunning like SQL Processing, Optimizer and Execution Plan, Accessing Tables, Performance Improvement Consideration Partition Technique. Presented by Alphalogic Inc : https://www.alphalogicinc.com/
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 ...
Performance tuning and optimization on client serverSatya P. Joshi
Performance tuning and optimization on client server, client server performance tuning and optimization techniques, Performance tuning and optimization on client server, Performance tuning and optimization on client server
This presentation discusses the following topics:
Introduction to Query Processing
Need for Query processing
Architecture of Query Processing
Query Processing Steps
Phases in a typical query processing
Represented in relational structures
Translating SQL Queries into Relational Algebra
Query Optimization
Importance of Query Optimization
Actions of Query Optimization
● Distributed Database Management Systems Advantages and Disadvantages.
● Characteristics of Distributed Database Management Systems.
● Levels of Data and Process Distribution.
● Distributed Database Transparency Features.
● Transaction Performance and Failure Transparency.
● Data Modeling and Data Models.
● Business Rules (Translating Business Rules into Data Model Components).
● Emerging Data Models: Big Data and NoSQL.
● Degrees of Data Abstraction (External, Conceptual, Internal and Physical model).
● Why Databases?
● Why Database Design is Important?
● The Database System Environment and Functions.
● Managing the Database System: A Shift in Focus.
Data Science is a field where we apply 'science' to available 'data' in order to get the 'patterns' or 'insights' which can help a business to optimize operations or improvise decisions.
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]Usman Tariq
In this PPT, you will learn:
• About data modeling and why data models are important
• About the basic data-modeling building blocks
• What business rules are and how they influence database design
• How the major data models evolved
• About emerging alternative data models and the needs they fulfill
• How data models can be classified by their level of abstraction
Author: Carlos Coronel | Steven Morris
In this PPT, you will learn:
• The difference between data and information
• What a database is, the various types of databases, and why they are valuable assets for
decision making
• The importance of database design
• How modern databases evolved from file systems
• About flaws in file system data management
• The main components of the database system
• The main functions of a database management system (DBMS)
E-marketing is a process of planning and executing the conception, distribution, promotion, and pricing of products and services in a computerized, networked environment, such as the Internet and the World Wide Web, to facilitate exchanges and satisfy customer demands.
ERP modules and business software packageUsman Tariq
In organization, ERP helps to manage business processes of various departments & functions through centralized application. We can make all the major decisions by screening the information provided by ERP.
There are many vendors in market which are providing traditional ERP solutions or Cloud based ERP solutions. Though implementation platforms or technologies are different, there are common & basic modules of ERP which can be found in any ERP System. Depending on organizations need required components are integrated & customized ERP system is formed. All the below mentioned modules can be found in any ERP system:
• Human Resource, Inventory, Sales & Marketing, Purchase, Finance & Accounting, Customer Relationship Management (CRM), Engineering/ Production, Supply Chain Management (SCM)
Each component mentioned above is specialized to handle defined business processes of organization. Let us go through the introduction of the various modules.
ERP Implementation Challenges and Package SelectionUsman Tariq
ERP implementations have a nasty reputation for being challenging.
These challenges can lead to your ERP implementation project taking too much time and being over budget.
The result can be you being left with an underperforming solution. Or, you avoiding implementation of an ERP at all costs.
While the challenges are real, they shouldn’t stop you from implementing one.
Discuss overall trends in Internet access, usage, and purchasing around the world.
Define emerging economies and explain the vital role of information technology in economic development.
Outline how e-marketers apply market similarity and analyze online purchase and payment behaviors in planning market entry opportunities.
Deploying an enterprise resource planning (ERP) system is an expensive proposition, not just in terms of licensing and maintenance, but in terms of dedicated resources and time. The implementation of ERP systems has helped small and mid-sized companies, significantly improve their business metrics by process optimization, improving the entire supply chain process, better inventory control, better reporting to take decisions, integration across functionalities and increasing transparency across the company. Purchase department can see the sales department data, Sales department can see inventory data, and top management can see any data on a click of single button.
Customer Relationship Management (CRM) is a strategy for managing all your company’s relationships and interactions with customers and potential customers. It helps you stay connected to them, streamline processes and improve your profitability.
More commonly, when people talk about CRM they are usually referring to a CRM system, a tool which helps with contact management, sales management, productivity and more.
Customer Relationship Management enables you to focus on your organization’s relationships with individual people – whether those are customers, service users, colleagues or suppliers. CRM is not just for sales. Some of the biggest gains in productivity can come from moving beyond CRM as a sales and marketing tool and embedding it in your business – from HR to customer services and supply-chain management.
A marketing plan should be a formal written document, not recalled from memory or something scribbled on a napkin. To take your business to the next level requires preparing a written marketing action plan.
Strategic E-Marketing and Performance MetricsUsman Tariq
E-marketing means using digital technologies such as websites, mobile devices and social networking to help reach your customers, create awareness of your brand and sell your goods or services. The basics of marketing remain the same - creating a strategy to deliver the right messages to the right people.
ERP is an acronym for Enterprise Resource Planning, but even its full name doesn't shed much light on what ERP is or what it does. For that, you need to take a step back and think about all of the various processes that are essential to running a business, including inventory and order management, accounting, human resources, customer relationship management (CRM), and beyond. At its most basic level, ERP software integrates these various functions into one complete system to streamline processes and information across the entire organization.
The central feature of all ERP systems is a shared database that supports multiple functions used by different business units. In practice, this means that employees in different divisions—for example, accounting and sales—can rely on the same information for their specific needs.
E-Marketing (past, present, and future)Usman Tariq
Textbook Title: “E-Marketing, 8th E": international Edition
Author: Raymond D. Frost, Alexa Fox, Judy Strauss
Publisher: Taylor & Francis, ISBN-13: 9781138731370
Year/Edition: 8th ed. was published by Rutledge
Publication Date: 2018-10-18
ERP integrates business of an organization through a centralized database. The organizational data and transaction data are stored in the database. This data is a rich source of information. There are many software tools that would process the data and discover useful patterns. These techniques are referred to as data mining. The data from an ERP system may not be directly usable by data mining tools. The data may have to be pre-processed and made ready for data mining. A data warehouse is created from the ERP data that makes the data ready for data mining. An organization needs to interact with their suppliers for obtaining the raw material or semi-finished goods. They also need to interact with their retailers and dealers. These interactions may happen using EDI technology. Supply chain management (SCM) refers to managing suppliers and retailers. Customers are the reason why a business exists. The focus has changed from providing customer a product to providing a service built around the product. Customer relationship management (CRM) is the technology that helps an organization to manage its customers. CRM and SCM both integrate with ERP system and are collectively referred to as ERP-II.
In the computer industry, an enterprise is an organization that uses computers. A word was needed that would encompass corporations, small businesses, non-profit institutions, government bodies, and possibly other kinds of organizations. The term enterprise seemed to do the job. In practice, the term is applied much more often to larger organizations than smaller ones.
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Generating a custom Ruby SDK for your web service or Rails API using Smithyg2nightmarescribd
Have you ever wanted a Ruby client API to communicate with your web service? Smithy is a protocol-agnostic language for defining services and SDKs. Smithy Ruby is an implementation of Smithy that generates a Ruby SDK using a Smithy model. In this talk, we will explore Smithy and Smithy Ruby to learn how to generate custom feature-rich SDKs that can communicate with any web service, such as a Rails JSON API.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
2. Learning Objectives
In this chapter, the student 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 2
3. 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 that
all factors must operate at optimum level with
minimal bottlenecks
3
4. Table 11.1 - General Guidelines for Better
System Performance
4
5. Performance Tuning: Client and Server
Client side
SQL performance tuning: Generates 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
configured to respond to clients’ requests as fast as
possible
Optimum use of existing resources
5
9. Example: to generate statistics for the
VENDOR table, you would use:
1. In Oracle:
ANALYZE TABLE VENDOR COMPUTE
STATISTICS;
2. In MySQL:
ANALYZE TABLE VENDOR;
3. In SQL Server:
UPDATE STATISTICS VENDOR;
9
It is common to periodically regenerate the statistics for database objects,
especially database objects that are subject to frequent change.
10. Database analysis
10
Growth trend of the database in total, the data files, the transaction logs,
and the filestream data, for the selected period
11. Select more fields to avoid
SELECT DISTINCT
Inefficient:
SELECT * FROM Customers
Efficient:
SELECT FirstName, LastName, Address,
City, State, Zip FROM Customers
Inefficient and inaccurate:
SELECT DISTINCT FirstName, LastName,
State FROM Customers
11
13. Query Processing [1/2]
Parsing. The DBMS parses the SQL query and
chooses the most efficient access/execution plan.
Execution. The DBMS executes the SQL query using
the chosen execution plan.
Fetching. The DBMS fetches the data and sends the
result set back to the client.
13
SQL query is:
1. Validated for syntax compliance
2. Validated against the data dictionary to ensure that table names and column
names are correct
3. Validated against the data dictionary to ensure that the user has proper
access rights
4. Analyzed and decomposed into more atomic components
15. SQL Parsing Phase
Query is broken down into smaller
units
Original SQL query is transformed
into slightly different version of
the original SQL code which is
fully equivalent and more efficient
Query optimizer: Analyzes SQL
query and finds most efficient way
to access data
Access plans: DBMS-specific and
translate client’s SQL query into a
series of complex I/O operations
15
16. SQL Parsing
Syntax Check
Oracle Database must check each SQL statement for
syntactic validity.
A statement that breaks a rule for well-formed SQL
syntax fails the check. For example, the following
statement fails because the keyword FROM is misspelled
as FORM:
16
external
17. SQL Parsing
Semantic Check
A semantic check determines whether a statement is
meaningful, for example, whether the objects and
columns in the statement exist.
A syntactically correct statement can fail a semantic
check, as shown in the following example of a query of a
nonexistent table:
17
external
18. SQL Parsing
Shared Pool Check
Shared Pool is a portion of the System Global Area (SGA) that contains shared
memory constructs such as shared SQL areas.
During the parse, the database performs a shared pool check to determine whether it
can skip resource-intensive steps of statement processing.
18
external
19. SQL Parsing Phase
If Query Access Plan already exists for query in SQL
cache, DBMS reuses it
If not, optimizer evaluates various plans and chooses
one to be placed in SQL cache for use
19
ParallelQueryAccessPlan
20. Create joins with INNER JOIN rather than
WHERE
SELECT Customers.CustomerID, Customers.Name,
Sales.LastSaleDate FROM Customers, Sales WHERE
Customers.CustomerID = Sales.CustomerID
20
SELECT Customers.CustomerID, Customers.Name,
Sales.LastSaleDate
FROM Customers
INNER JOIN Sales
ON Customers.CustomerID = Sales.CustomerID
The database would only generate the #### desired records where
CustomerID is equal
21. Use WHERE instead of HAVING to define
filters [1/2]
SELECT Customers.CustomerID, Customers.Name,
Count(Sales.SalesID) FROM Customers
INNER JOIN Sales
ON Customers.CustomerID = Sales.CustomerID
GROUP BY Customers.CustomerID,
Customers.Name
HAVING Sales.LastSaleDate BETWEEN #1/1/2019# AND
#12/31/2019#
21
SELECT Customers.CustomerID, Customers.Name,
Count(Sales.SalesID)
FROM Customers
INNER JOIN Sales
ON Customers.CustomerID = Sales.CustomerID
WHERE Sales.LastSaleDate BETWEEN #10/10/2019# AND
#17/10/2019#
GROUP BY Customers.CustomerID, Customers.Name
22. Use WHERE instead of HAVING to define
filters [2/2]
22
SELECT Customers.CustomerID, Customers.Name,
Count(Sales.SalesID)
FROM Customers
INNER JOIN Sales
ON Customers.CustomerID = Sales.CustomerID
WHERE Sales.LastSaleDate BETWEEN #10/10/2019# AND #17/10/2019#
GROUP BY Customers.CustomerID, Customers.Name
HAVING Count(Sales.SalesID) > 5
HAVING should only be used when filtering on an aggregated field. In
the query above, we could additionally filter for customers with greater
than 5 sales using a HAVING statement.
23. 23
1. Proper indexing
2. Retrieve the
relevant data
only
3. Getting rid of
correlated
subqueries
4. Using or
avoiding
temporary tables
according to
requirement
5. Avoid coding
loops
OPTIMIZATION
1. Proper indexing
2. Retrieve the
relevant data
only
3. Getting rid of
correlated
subqueries
4. Using or
avoiding
temporary tables
according to
requirement
5. Avoid coding
loops
MONITORING
PERFORMANCE
1. Monitor
Availability and
Resource
Consumption
2. Measure and
Compare
Throughput
3. Monitor
Expensive
Queries
4. Track Database
Changes
5. Monitor Logs
A data mart is a subset of a
data warehouse oriented to a
specific business line. Data
marts contain repositories of
summarized data collected
for analysis on a specific
section or unit within an
organization, for example,
the sales department.
The Oracle online table
reorganization package,
(dbms_redefinition) is used
to reorganize tables while
they are accepting updates.
Partitioning is the
database process where very
large tables are divided into
multiple smaller parts.
In computing, a materialized view is a database object that contains the
results of a query. For example, it may be a local copy of data located
remotely, or may be a subset of the rows and/or columns of a table or join
result, or may be a summary using an aggregate function.
external
24. Full Table Scan: Example
24
The following statement queries monthly
salaries over SAR 4000
26. Indexes and Query Optimization
Indexes are crucial in speeding up data access
because they facilitate searching, sorting, and using
aggregate functions and even join operations.
26
27. Index Range Scan: Example
27
SELECT *
FROM employees
WHERE department_id = 20
AND salary > 1000;
If indexes are so important, why not index every column in every table?
Indexing every column in every table overtaxes the DBMS in terms of index-
maintenance processing, especially if the table has many attributes and rows,
or requires many inserts, updates, and deletes.
28. Database Query Optimization Modes
Algorithms proposed for query optimization are
based on:
1. Selection of the optimum order to achieve the fastest
execution time
2. Selection of sites to be accessed to minimize
communication costs
Evaluated on the basis of:
1. Operation mode
2. Timing of its optimization
28
29. Query Blocks
Each SELECT block in the original SQL statement
is represented internally by a query block. A query
block can be a top-level statement, subquery, or
unmerged view.
29
external
32. Join Method Example
Adaptive Query Plans
SELECT product_name
FROM order_items o, prod_info p
WHERE o.unit_price = 15
AND quantity > 1
AND p.product_id = o.product_id
32
external
Hybrid Hash Distribution
EXPLAIN PLAN FOR
SELECT /*+ parallel(4) full(e) full(d) */
department_name, sum(salary)
FROM employees e, departments d
WHERE d.department_id=e.department_id
GROUP BY department_name;
35. Adaptive Query Plans
35
Statistics Feedback
SELECT o.order_id, v.product_name
FROM orders o,
( SELECT order_id, product_name
FROM order_items o, product_information p
WHERE p.product_id = o.product_id
AND list_price < 50
AND min_price < 40 ) v
WHERE o.order_id = v.order_id
external
36. Classification of Operation Modes
Automatic query optimization: DBMS finds the
most cost-effective access path without user
intervention
Manual query optimization: Requires that the
optimization be selected and scheduled by the end
user or programmer
36
37. 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
37
38. 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
38
39. DBMS Architecture
All data in a database are stored in data files
Data files automatically expand in predefined
increments known as extends
Data files are grouped in file groups or table spaces
Table space or file group: Logical grouping of several
data files that store data with similar characteristics
Data cache or buffer cache: Shared, reserved
memory area
Stores most recently accessed data blocks in RAM
39
40. DBMS Architecture
SQL cache or procedure cache: Stores most recently
executed SQL statements or PL/SQL procedures
DBMS retrieves data from permanent storage and
places them in RAM
Input/output request: Low-level data access
operation that reads or writes data to and from
computer devices
Data cache is faster than working with data files
Majority of performance-tuning activities focus on
minimizing I/O operations
40
41. Find Current Location of Data and Log
File of All the Database
41
SELECT name, physical_name AS current_file_location
FROM sys.master_files
44. SQL Execution Phase
All I/O operations indicated in the access plan are
executed
Locks are acquired
Data are retrieved and placed in data cache
Transaction management commands are processed
44
46. SQL Fetching Phase
Rows of resulting query result set are returned to
client
DBMS may use temporary table space to store
temporary data
Database server coordinates the movement of the result
set rows from the server cache to the client cache
46
47. Indexes and Query Optimization
Indexes
Help speed up data access
Facilitate searching, sorting, using aggregate functions, and join
operations
Ordered set of values that contain the index key and pointers
More efficient than a full table scan
47
SELECT *
FROM Table
WITH(INDEX(Index_Name))
external
48. Indexes and Query Optimization
Data sparsity: Number of different values a column could have
Data structures used to implement indexes:
Hash indexes
B-tree indexes
Bitmap indexes
DBMSs determine
best type of index
to use
48
50. Optimizer Choices
Rule-based optimizer: Uses preset rules and points
to determine the best approach to execute a query
Cost-based optimizer: Uses algorithms based on
statistics about objects being accessed to determine
the best approach to execute a query
50
51. Using Hints to Affect Optimizer
Choices
Optimizer might not choose the best execution plan
Makes decisions based on existing statistics, which
might be old
Might choose less-efficient decisions
Optimizer hints: Special instructions for the
optimizer, embedded in the SQL command text
51
52. Optimizer Hints
A hint is embedded within a SQL comment.
The hint comment must immediately follow the first keyword of a SQL
statement block. You can use either style of comment: a slash-star (/*) or pair of
dashes (--). The plus-sign (+) hint delimiter must immediately follow the
comment delimiter, with no space permitted before the plus sign, as in the
following fragment:
52
external
54. 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 and thus rarely portable
Majority of performance problems are related to
poorly written SQL code
54
55. Index Selectivity
Measure of the likelihood that an index will be used
in query processing
Indexes are used when a subset of rows from a large
table is to be selected based on a given condition
Index cannot always be used to improve performance
Function-based index: Based on a specific SQL
function or expression
55
56. Conditional Expressions
Expressed within WHERE or HAVING clauses of a
SQL statement
Restricts the output of a query to only rows matching
conditional criteria
Guidelines to write efficient conditional expressions
in SQL code
Use simple columns or literals as operands
Numeric field comparisons are faster than character,
date, and NULL comparisons
56
57. SQL Expressions
Oracle Database does not accept
all forms of expressions in all
parts of all SQL statements.
Information URL
57
external
58. Conditional Expressions
Equality comparisons are faster than inequality
comparisons
Transform conditional expressions to use literals
Write equality conditions first when using multiple
conditional expressions
When using multiple AND conditions, write the
condition most likely to be false first
When using multiple OR conditions, put the condition
most likely to be true first
Avoid the use of NOT logical operator
58
59. Query Formulation
Identify what columns and computations are required
Identify source tables
Determine how to join tables
Determine what selection criteria are needed
Determine the order in which to display the output
59
60. DBMS Performance Tuning
Managing DBMS processes in primary memory and
the structures in physical storage
DBMS performance tuning at server end focuses on
setting parameters used for:
1. Data cache
2. SQL cache
3. Sort cache
4. Optimizer mode
In-memory database: Store large portions of the
database in primary storage
60
61. DBMS Performance Tuning
Recommendations for physical storage of databases:
Use RAID (Redundant Array of Independent Disks) to
provide a balance between performance improvement
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, and high-usage tables
61
62. DBMS Performance Tuning
Take advantage of the various table storage
organizations in the database
Index-organized table or clustered index table: Stores
the end-user data and the index data in consecutive
locations in permanent storage
Partition tables based on usage
Use denormalized tables where appropriate
Store computed and aggregate attributes in tables
62
63. 63
Databases, tablespaces, and datafiles are closely related, but they have important
differences:
• An Oracle database consists of one or more logical storage units called
tablespaces, which collectively store all of the database's data.
• Each tablespace in an Oracle database consists of one or more files called
datafiles, which are physical structures that conform to the operating system in
which Oracle is running.
• A database's data is collectively stored in the datafiles that constitute each
tablespace of the database. For example, the simplest Oracle database would
have one tablespace and one datafile. Another database can have three
tablespaces, each consisting of two datafiles (for a total of six datafiles).
external
64. CREATE TABLESPACE
Create a Shadow Tablespace: Example
64
The following example creates a 10 MB undo tablespace undots1:
65. Creating a Temporary Tablespace:
Example
This statement shows how the temporary tablespace
that serves as the default temporary tablespace for
database users in the sample database was created:
65
66. Enabling Autoextend for a Tablespace:
Example
66
This statement creates a tablespace named tbs_02 with one
data file. When more space is required, 500 kilobyte
extents will be added up to a maximum size of 100
megabytes:
67. Using Multiple Tablespaces
You can use multiple tablespaces to perform the
following tasks:
1. Control disk space allocation for database data
2. Assign specific space quotas for database users
3. Control availability of data by taking individual
tablespaces online or offline
4. Perform partial database backup or recovery
operations
5. Allocate data storage across devices to improve
performance
67
external
68. Using Tablespaces
A database administrator can use tablespaces to do
the following actions:
1. Create new tablespaces
2. Add datafiles to tablespaces
3. Set and alter default segment storage settings for
segments created in a tablespace
4. Make a tablespace read only or read/write
5. Make a tablespace temporary or permanent
6. Rename tablespaces
7. Drop tablespaces
68
external
69. Create TABLESPCE: Example
69
CREATE TABLESPACE lmtbsb DATAFILE
'/u02/oracle/data/lmtbsb01.dbf' SIZE 50M
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K;
In this example, a 128K extent size is specified. Each 128K
extent (which, if the tablespace block size is 2K, is equivalent to
64 Oracle blocks) is represented by a bit in the extent bitmap
for this file.
70. Make a tablespace read only
70
ALTER TABLESPACE sales_1 READ ONLY;
ALTER TABLESPACE LMS_Student READ ONLY;
71. Creating Oracle Managed Files:
Examples
71
CREATE TABLESPACE omf_ts2 DATAFILE
AUTOEXTEND OFF;
The following example creates a tablespace with an
Oracle-managed data file of 100M that is not
autoextensible:
ALTER SYSTEM SET DB_CREATE_FILE_DEST =
'$ORACLE_HOME/rdbms/dbs';
CREATE TABLESPACE omf_ts1;
The following example sets the default location for data file
creation and creates a tablespace with a data file in the default
location. The data file is 100M and is autoextensible with an
unlimited maximum size:
Editor's Notes
Indexes are special lookup tables that the database search engine can use to speed up data retrieval. Simply put, an index is a pointer to data in a table. An index in a database is very similar to an index in the back of a book.
A histogram is a graphical display of data using bars of different heights. In a histogram, each bar groups numbers into ranges. Taller bars show that more data falls in that range. A histogram displays the shape and spread of continuous sample data.
s
When you generate statistics for a table, all related indexes are also analyzed. However,
you could generate statistics for a single index by using the following command, where VEND_NDX is the name of the index:
ANALYZE INDEX VEND_NDX COMPUTE STATISTICS;
The SELECT DISTINCT statement is used to return only distinct (different) values. Inside a table, a column often contains many duplicate values; and sometimes you only want to list the different (distinct) values.
SELECT DISTINCT sp.atcoCode, sp.name, sp.longitude, sp.latitude FROM `transportdata`.stoppoints as sp INNER JOIN `vehicledata`.gtfsstop_times as st ON sp.atcoCode = st.fk_atco_code INNER JOIN `vehicledata`.gtfstrips as trip ON st.trip_id = trip.trip_id INNER JOIN `vehicledata`.gtfsroutes as route ON trip.route_id = route.route_id INNER JOIN `vehicledata`.gtfsagencys as agency ON route.agency_id = agency.agency_id WHERE agency.agency_id IN (1,2,3,4);
This graphic shows a shared pool check. At the top are three boxes laid on top of one another, each box smaller than the one behind it. The smallest box shows hash values and is labeled Shared SQL Area. The second box is labeled Shared Pool. The outer box is labeled SGA. Below this box is another box labeled PGA. Within the PGA box is a box labeled Private SQL Area, which contains a hash value. A double-ended arrow connects the upper and lower boxes and is labeled "Comparison of hash values." To the right of the PGA box is a person icon labeled User Process. The icons are connected by a double-sided arrow. Above the User Process icon is an "Update ...." statement. An arrow leads from the User Process below so the Server Process icon below.
The INNER JOIN selects all rows from both participating tables as long as there is a match between the columns.
HAVING should only be used when filtering on an aggregated field.
If there is no index, the DBMS will perform a full-table scan and read all 14,786 customer rows. Assuming that the index STATE_NDX is created (and analyzed), the DBMS
will automatically use the index to locate the first customer with a state equal to 'FL' and hen proceed to read all subsequent CUSTOMER rows, using the row IDs in the index as a guide. Assuming that only five rows meet the condition CUS_STATE = 'FL' there are five accesses to the index and five accesses to the data, for a total of 10 I/O accesses. The DBMS would be saved from reading approximately 14,776 I/O requests for customer rows that do not meet the criteria. That is a lot of CPU cycles!
This flowchart diagram shows the SQL Tuning Sets APIs.
The following SQL Tuning Set API procedures are shown: CREATE_SQLSET, DROP_SQLSET, LOAD_SQLSET, UNPACK_STQTAB_SQLSET, and PACK_STQTAB_SQLSET. All procedures either lead into or from the SQL Tuning Set (STS).
Three input sources are shown leading into the LOAD_SQLSET procedure: cursor cache, AWR, and another STS.
Assume that the value of SPARSEINDEX is BTREE. The following statements define two objects: a named composite that has a b-tree index and base dimensions of market and a variable called expenses that is dimensioned by the month dimension and the market.product composite.