SlideShare a Scribd company logo
1 of 27
Emrah METE
TURKCELL TEKNOLOJİ
OPTIMIZING DATA ACCESS
http://emrahmete.wordpress.com/about/
Marmara Üniversitesi - Bilgisayar Teknolojisi ve
Programlama
Yıldız Teknik Üniversitesi - Bilgisayar Mühendisliği
Turkcell Teknoloji - Yazılım Geliştirme Mühendisi
emrahmete.wordpress.com
TROUG – Kurucu Üye, Yönetim Kurulu Üyeliği
Emrah METE
Yahoo OracleTurk Grubu Moderatör
Agenda
- How to find efficient access path?
- Logical Reads
- Main Causes of Inefficient Access Paths and Solutions
- Selectivity
- SQL Statements with Weak Selectivity
- Full Table Scans
- Full Partition Scans
- Full Index Scans
- SQL Statements with Strong Selectivity
- Rowid Access
- Index Access
- Single Table Hash Cluster Access
How to find efficient access path?
- Resource Consumption
- Efficiency / Speed
- Resource Utilization
Logical Reads
• CPU bound operation, it reflects CPU
utilization very well.
• Logical reads might lead to physical reads.
• Logical Reads is an operation subject to
serialization.
• Logical Reads is readily available at athe SQL
statement and execution plan operation
levels.
Logical Reads
• 5 logical reads per returned row  Good
• Between 10 and 15 logical reads per returned row  Acceptable
• Between 15 and 20 logical reads per returned row  Inefficient
Logical Reads
Main Causes of Inefficient Access
Paths and Solutions
Causes
• No suitable access structures (for example,
indexes) are available.
• A suitable access structure is available, but
the syntax of the SQL statement does not
allow the query optimizer to use it.
• The table or the index, or both, is not
partitioned.
• Query optimizer makes wrong estimations
because of a lack of statistics
Solutions
• Minimize the number of logical reads.
• Add new access structers or change pysical
layout.
• Up to date table statistics.
• Selectivity
- Operations with weak (high) selectivity
- Operations with strong (low) selectivity
Selectivity
Selectivity = number of return rows / total rows
SQL Statements with Weak Selectivtiy
- Full Table Scans
- Full Partition Scans
- Full Index Scans
FULL TABLE SCANS
• It is possible to perform a full
table scan on all tables
• the database engine reads all
of the table’s blocks below the
high watermark sequentially
FULL TABLE SCANS
Total Rows: 10000
N2=19: 24 Rows
Case1: Case2:
- Alter Table Enable Row Movement
- Alter Table Shrink Space
Partitioning
FULL PARTITION SCANS
FULL INDEX SCANS
SQL Statements with Strong
Selectivtiy
- Rowid Access
- Index Access
- Single Table Hash Cluster Access
ROWID ACCESS
- The most efficient way to access a row is to directly specify
its rowid in the where clause.
Data Object
Number
Relative File
Number
Block
Number
Row Number
ROWID FORMAT
10 Byte
ÖR:AAAR5cAAFAAAACfAAA
ROWID ACCESS
INDEX ACCESS
- Index accesses are by far the most often used access paths
for SQL statements with strong selectivity.
CLUSTERING FACTOR
BITMAP INDEXES
B-TREE vs BITMAP Indexes
- Primary Key and Unique Key
- Row-Level Locking
- Efficient Combination Of Several Indexes
- IS NULL Condition
- Compression
INDEX ORGANIZED TABLES
SINGLE TABLE HASH CLUSTER ACCESS
SORULAR/YORUMLAR
Kaynaklar
- docs.oracle.com
- TroubleShooting Oracle Performance,
Chapter9, Christian Antognini, 2008
- emrahmete.wordpress.com
- Expert Oracle Database Architecture, Tom Kyte
2011
- tahiti.oracle.com
Teşekkürler

More Related Content

What's hot

Less01 db architecture
Less01 db architectureLess01 db architecture
Less01 db architectureImran Ali
 
Less08 managing data and concurrency
Less08 managing data and concurrencyLess08 managing data and concurrency
Less08 managing data and concurrencyImran Ali
 
Analysis of mysql and postgresql
Analysis of mysql and postgresqlAnalysis of mysql and postgresql
Analysis of mysql and postgresqlAsif Anik
 
Less07 schema
Less07 schemaLess07 schema
Less07 schemaImran Ali
 
Oracle SQL Tuning for Day-to-Day Data Warehouse Support
Oracle SQL Tuning for Day-to-Day Data Warehouse SupportOracle SQL Tuning for Day-to-Day Data Warehouse Support
Oracle SQL Tuning for Day-to-Day Data Warehouse Supportnkarag
 
Less17 flashback tb3
Less17 flashback tb3Less17 flashback tb3
Less17 flashback tb3Imran Ali
 
Less04 instance
Less04 instanceLess04 instance
Less04 instanceImran Ali
 
Oracle Data Redaction - EOUC
Oracle Data Redaction - EOUCOracle Data Redaction - EOUC
Oracle Data Redaction - EOUCAlex Zaballa
 
New Stuff in the Oracle PL/SQL Language
New Stuff in the Oracle PL/SQL LanguageNew Stuff in the Oracle PL/SQL Language
New Stuff in the Oracle PL/SQL LanguageSteven Feuerstein
 
Web application penetration using SQLMAP.
Web application penetration using SQLMAP.Web application penetration using SQLMAP.
Web application penetration using SQLMAP.asmitaanpat
 
TSQL in SQL Server 2012
TSQL in SQL Server 2012TSQL in SQL Server 2012
TSQL in SQL Server 2012Eduardo Castro
 
PL/SQL Tips and Techniques Webinar Presentation
PL/SQL Tips and Techniques Webinar PresentationPL/SQL Tips and Techniques Webinar Presentation
PL/SQL Tips and Techniques Webinar PresentationEmbarcadero Technologies
 
שבוע אורקל 2016
שבוע אורקל 2016שבוע אורקל 2016
שבוע אורקל 2016Aaron Shilo
 
Less06 users
Less06 usersLess06 users
Less06 usersImran Ali
 
Getting to know oracle database objects iot, mviews, clusters and more…
Getting to know oracle database objects iot, mviews, clusters and more…Getting to know oracle database objects iot, mviews, clusters and more…
Getting to know oracle database objects iot, mviews, clusters and more…Aaron Shilo
 
Top 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tipsTop 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tipsNirav Shah
 
Less10 security mb3
Less10 security mb3Less10 security mb3
Less10 security mb3Imran Ali
 

What's hot (19)

Less01 db architecture
Less01 db architectureLess01 db architecture
Less01 db architecture
 
Less08 managing data and concurrency
Less08 managing data and concurrencyLess08 managing data and concurrency
Less08 managing data and concurrency
 
Analysis of mysql and postgresql
Analysis of mysql and postgresqlAnalysis of mysql and postgresql
Analysis of mysql and postgresql
 
Less07 schema
Less07 schemaLess07 schema
Less07 schema
 
Oracle performance tuning online training
Oracle performance tuning online training Oracle performance tuning online training
Oracle performance tuning online training
 
Oracle SQL Tuning for Day-to-Day Data Warehouse Support
Oracle SQL Tuning for Day-to-Day Data Warehouse SupportOracle SQL Tuning for Day-to-Day Data Warehouse Support
Oracle SQL Tuning for Day-to-Day Data Warehouse Support
 
Less17 flashback tb3
Less17 flashback tb3Less17 flashback tb3
Less17 flashback tb3
 
Less04 instance
Less04 instanceLess04 instance
Less04 instance
 
Oracle Data Redaction - EOUC
Oracle Data Redaction - EOUCOracle Data Redaction - EOUC
Oracle Data Redaction - EOUC
 
New Stuff in the Oracle PL/SQL Language
New Stuff in the Oracle PL/SQL LanguageNew Stuff in the Oracle PL/SQL Language
New Stuff in the Oracle PL/SQL Language
 
Web application penetration using SQLMAP.
Web application penetration using SQLMAP.Web application penetration using SQLMAP.
Web application penetration using SQLMAP.
 
TSQL in SQL Server 2012
TSQL in SQL Server 2012TSQL in SQL Server 2012
TSQL in SQL Server 2012
 
PL/SQL Tips and Techniques Webinar Presentation
PL/SQL Tips and Techniques Webinar PresentationPL/SQL Tips and Techniques Webinar Presentation
PL/SQL Tips and Techniques Webinar Presentation
 
שבוע אורקל 2016
שבוע אורקל 2016שבוע אורקל 2016
שבוע אורקל 2016
 
Less06 users
Less06 usersLess06 users
Less06 users
 
Getting to know oracle database objects iot, mviews, clusters and more…
Getting to know oracle database objects iot, mviews, clusters and more…Getting to know oracle database objects iot, mviews, clusters and more…
Getting to know oracle database objects iot, mviews, clusters and more…
 
Oracle SQL Tuning
Oracle SQL TuningOracle SQL Tuning
Oracle SQL Tuning
 
Top 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tipsTop 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tips
 
Less10 security mb3
Less10 security mb3Less10 security mb3
Less10 security mb3
 

Similar to Opti̇mi̇zi̇ng Data Access

MemSQL 201: Advanced Tips and Tricks Webcast
MemSQL 201: Advanced Tips and Tricks WebcastMemSQL 201: Advanced Tips and Tricks Webcast
MemSQL 201: Advanced Tips and Tricks WebcastSingleStore
 
Query Optimization in SQL Server
Query Optimization in SQL ServerQuery Optimization in SQL Server
Query Optimization in SQL ServerRajesh Gunasundaram
 
Presentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12cPresentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12cRonald Francisco Vargas Quesada
 
Myth busters - performance tuning 102 2008
Myth busters - performance tuning 102 2008Myth busters - performance tuning 102 2008
Myth busters - performance tuning 102 2008paulguerin
 
Tuning ETL's for Better BI
Tuning ETL's for Better BITuning ETL's for Better BI
Tuning ETL's for Better BIDatavail
 
Database Systems Design, Implementation, and Management
Database Systems Design, Implementation, and ManagementDatabase Systems Design, Implementation, and Management
Database Systems Design, Implementation, and ManagementOllieShoresna
 
Presentation cloud control enterprise manager 12c
Presentation   cloud control enterprise manager 12cPresentation   cloud control enterprise manager 12c
Presentation cloud control enterprise manager 12cxKinAnx
 
An AMIS Overview of Oracle database 12c (12.1)
An AMIS Overview of Oracle database 12c (12.1)An AMIS Overview of Oracle database 12c (12.1)
An AMIS Overview of Oracle database 12c (12.1)Marco Gralike
 
Performance Tuning And Optimization Microsoft SQL Database
Performance Tuning And Optimization Microsoft SQL DatabasePerformance Tuning And Optimization Microsoft SQL Database
Performance Tuning And Optimization Microsoft SQL DatabaseTung Nguyen Thanh
 
Real World Performance - OLTP
Real World Performance - OLTPReal World Performance - OLTP
Real World Performance - OLTPConnor McDonald
 
Introduction to execution plan analysis
Introduction to execution plan analysisIntroduction to execution plan analysis
Introduction to execution plan analysisJohn Sterrett
 
Jethro for tableau webinar (11 15)
Jethro for tableau webinar (11 15)Jethro for tableau webinar (11 15)
Jethro for tableau webinar (11 15)Remy Rosenbaum
 
Efficient transaction processing in sap hana
Efficient transaction processing in sap hanaEfficient transaction processing in sap hana
Efficient transaction processing in sap hanaMysa Vijay
 
Optimizing Application Performance - 2022.pptx
Optimizing Application Performance - 2022.pptxOptimizing Application Performance - 2022.pptx
Optimizing Application Performance - 2022.pptxJasonTuran2
 
Brad McGehee Intepreting Execution Plans Mar09
Brad McGehee Intepreting Execution Plans Mar09Brad McGehee Intepreting Execution Plans Mar09
Brad McGehee Intepreting Execution Plans Mar09guest9d79e073
 
Brad McGehee Intepreting Execution Plans Mar09
Brad McGehee Intepreting Execution Plans Mar09Brad McGehee Intepreting Execution Plans Mar09
Brad McGehee Intepreting Execution Plans Mar09Mark Ginnebaugh
 

Similar to Opti̇mi̇zi̇ng Data Access (20)

Sql performance tuning
Sql performance tuningSql performance tuning
Sql performance tuning
 
MemSQL 201: Advanced Tips and Tricks Webcast
MemSQL 201: Advanced Tips and Tricks WebcastMemSQL 201: Advanced Tips and Tricks Webcast
MemSQL 201: Advanced Tips and Tricks Webcast
 
Query Optimization in SQL Server
Query Optimization in SQL ServerQuery Optimization in SQL Server
Query Optimization in SQL Server
 
Presentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12cPresentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12c
 
Myth busters - performance tuning 102 2008
Myth busters - performance tuning 102 2008Myth busters - performance tuning 102 2008
Myth busters - performance tuning 102 2008
 
NoSql
NoSqlNoSql
NoSql
 
Tuning ETL's for Better BI
Tuning ETL's for Better BITuning ETL's for Better BI
Tuning ETL's for Better BI
 
Database Systems Design, Implementation, and Management
Database Systems Design, Implementation, and ManagementDatabase Systems Design, Implementation, and Management
Database Systems Design, Implementation, and Management
 
Presentation cloud control enterprise manager 12c
Presentation   cloud control enterprise manager 12cPresentation   cloud control enterprise manager 12c
Presentation cloud control enterprise manager 12c
 
An AMIS Overview of Oracle database 12c (12.1)
An AMIS Overview of Oracle database 12c (12.1)An AMIS Overview of Oracle database 12c (12.1)
An AMIS Overview of Oracle database 12c (12.1)
 
Performance Tuning And Optimization Microsoft SQL Database
Performance Tuning And Optimization Microsoft SQL DatabasePerformance Tuning And Optimization Microsoft SQL Database
Performance Tuning And Optimization Microsoft SQL Database
 
Real World Performance - OLTP
Real World Performance - OLTPReal World Performance - OLTP
Real World Performance - OLTP
 
An AMIS overview of database 12c
An AMIS overview of database 12cAn AMIS overview of database 12c
An AMIS overview of database 12c
 
Introduction to execution plan analysis
Introduction to execution plan analysisIntroduction to execution plan analysis
Introduction to execution plan analysis
 
Tunning overview
Tunning overviewTunning overview
Tunning overview
 
Jethro for tableau webinar (11 15)
Jethro for tableau webinar (11 15)Jethro for tableau webinar (11 15)
Jethro for tableau webinar (11 15)
 
Efficient transaction processing in sap hana
Efficient transaction processing in sap hanaEfficient transaction processing in sap hana
Efficient transaction processing in sap hana
 
Optimizing Application Performance - 2022.pptx
Optimizing Application Performance - 2022.pptxOptimizing Application Performance - 2022.pptx
Optimizing Application Performance - 2022.pptx
 
Brad McGehee Intepreting Execution Plans Mar09
Brad McGehee Intepreting Execution Plans Mar09Brad McGehee Intepreting Execution Plans Mar09
Brad McGehee Intepreting Execution Plans Mar09
 
Brad McGehee Intepreting Execution Plans Mar09
Brad McGehee Intepreting Execution Plans Mar09Brad McGehee Intepreting Execution Plans Mar09
Brad McGehee Intepreting Execution Plans Mar09
 

Recently uploaded

Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfRachmat Ramadhan H
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Delhi Call girls
 
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Delhi Call girls
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Valters Lauzums
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusTimothy Spann
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxJohnnyPlasten
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...amitlee9823
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...amitlee9823
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceDelhi Call girls
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfadriantubila
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxolyaivanovalion
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFxolyaivanovalion
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...amitlee9823
 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023ymrp368
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% SecurePooja Nehwal
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxolyaivanovalion
 

Recently uploaded (20)

Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdfMarket Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
Market Analysis in the 5 Largest Economic Countries in Southeast Asia.pdf
 
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in  KishangarhDelhi 99530 vip 56974 Genuine Escort Service Call Girls in  Kishangarh
Delhi 99530 vip 56974 Genuine Escort Service Call Girls in Kishangarh
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
 
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptxLog Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptx
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls CP 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
 
Midocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFxMidocean dropshipping via API with DroFx
Midocean dropshipping via API with DroFx
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Punjabi Bagh 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptx
 

Opti̇mi̇zi̇ng Data Access

  • 2. http://emrahmete.wordpress.com/about/ Marmara Üniversitesi - Bilgisayar Teknolojisi ve Programlama Yıldız Teknik Üniversitesi - Bilgisayar Mühendisliği Turkcell Teknoloji - Yazılım Geliştirme Mühendisi emrahmete.wordpress.com TROUG – Kurucu Üye, Yönetim Kurulu Üyeliği Emrah METE Yahoo OracleTurk Grubu Moderatör
  • 3. Agenda - How to find efficient access path? - Logical Reads - Main Causes of Inefficient Access Paths and Solutions - Selectivity - SQL Statements with Weak Selectivity - Full Table Scans - Full Partition Scans - Full Index Scans - SQL Statements with Strong Selectivity - Rowid Access - Index Access - Single Table Hash Cluster Access
  • 4. How to find efficient access path? - Resource Consumption - Efficiency / Speed - Resource Utilization
  • 5. Logical Reads • CPU bound operation, it reflects CPU utilization very well. • Logical reads might lead to physical reads. • Logical Reads is an operation subject to serialization. • Logical Reads is readily available at athe SQL statement and execution plan operation levels.
  • 6. Logical Reads • 5 logical reads per returned row  Good • Between 10 and 15 logical reads per returned row  Acceptable • Between 15 and 20 logical reads per returned row  Inefficient
  • 8. Main Causes of Inefficient Access Paths and Solutions Causes • No suitable access structures (for example, indexes) are available. • A suitable access structure is available, but the syntax of the SQL statement does not allow the query optimizer to use it. • The table or the index, or both, is not partitioned. • Query optimizer makes wrong estimations because of a lack of statistics Solutions • Minimize the number of logical reads. • Add new access structers or change pysical layout. • Up to date table statistics. • Selectivity - Operations with weak (high) selectivity - Operations with strong (low) selectivity
  • 9. Selectivity Selectivity = number of return rows / total rows
  • 10. SQL Statements with Weak Selectivtiy - Full Table Scans - Full Partition Scans - Full Index Scans
  • 11. FULL TABLE SCANS • It is possible to perform a full table scan on all tables • the database engine reads all of the table’s blocks below the high watermark sequentially
  • 12. FULL TABLE SCANS Total Rows: 10000 N2=19: 24 Rows Case1: Case2: - Alter Table Enable Row Movement - Alter Table Shrink Space
  • 16. SQL Statements with Strong Selectivtiy - Rowid Access - Index Access - Single Table Hash Cluster Access
  • 17. ROWID ACCESS - The most efficient way to access a row is to directly specify its rowid in the where clause. Data Object Number Relative File Number Block Number Row Number ROWID FORMAT 10 Byte ÖR:AAAR5cAAFAAAACfAAA
  • 19. INDEX ACCESS - Index accesses are by far the most often used access paths for SQL statements with strong selectivity.
  • 22. B-TREE vs BITMAP Indexes - Primary Key and Unique Key - Row-Level Locking - Efficient Combination Of Several Indexes - IS NULL Condition - Compression
  • 24. SINGLE TABLE HASH CLUSTER ACCESS
  • 26. Kaynaklar - docs.oracle.com - TroubleShooting Oracle Performance, Chapter9, Christian Antognini, 2008 - emrahmete.wordpress.com - Expert Oracle Database Architecture, Tom Kyte 2011 - tahiti.oracle.com

Editor's Notes

  1. Efficiency or Speed: Efficient Access path her zaman en hızlı olan yöntemlerden biri olmayabilir. Parallel processing yeteneklerini kullanıp iyi response time’lar elde edebiliriz ancak, burada önemli olan nokta bu hızı ne kadar kaynak harcayarak yaptığımızıdır. Efficient access path, tüm sistem düşünüldüğünde SQL statementımızın daha az kaynak kullanarak (çünkü kaynaklar sınırlı), daha fazla ölçeklenebilir ve hızlı sonuçlar üretebilmesidir. Resource Utilization: Dönen satır sayısı ile doğrudan ilgilidir. Basit bir mantıkla dönen satır sayısı az ise resource utilization az, dönen satır sayısı çok ise resource utilization çoktur. Ama burada ana metrik dönen 1 satır sonucunda ne kadar kaynak kullanıldığının kontrol edilmesidir. Resource Consumption: İdeal hayatta, database engine tarafından yapılan kaynak tüketimi 4 başlık altında ölçümlenebilir. Bunlar CPU, Disk, Memory, Network ancak bu 4 parametre değerini toplayıp ölçümleyip değerlendirmek her bir SQL statementımız için oldukça zaman alıcı olabilir. Burada CPU’da bir satırın işlem görme süresi kullanılan CPU’ya bağımlı olarak değişkenlik gösterdiğin bu parametre üstünden yorum yapıp efficent access path’e gitmek oldukça zor olabilir (çünkü sistemden sisteme değişkenlik var CPU anlamında). Kullanılan memory miktarı döndürülen satır sayısına oranla değişebilir bazı durumlarda bilgiler doğrudan memory’den okunacağından dolayı network ve disk kaynakları her zaman kullanılmayadabilir. Uzun süren bir SQL’in hiç disk ve network kaynağı kullanmadan mütevazı bir memory kullanarak çalışıp sonuç döndürmesi aslında sıradan bir olaydır. - Database engine’in işi bitirebilmesi için bir çok şey söyleyebilen, toplaması kolay bir parametre var oda logical Read sayısıdır.
  2. Logical Reads: SQL çalıştığı esnada, buffer cache üzerinde bir block’a erişme olayına logical reads denir. SQL çalıştığı esnada buffer cache’den okunan blok sayısıda o sorgu için yapılan logical read sayısını gösterir. Lojik okuma fiziksel okumalarada neden olabileceğinden dolayı, logical read sayısını düşürmek yapıacak I/O miktarınıda azaltmak anlamına gelebilir.
  3. Logical Reads, overall Resource consumption bağlamında isabetli tahminlemeler yapmamıza olanak sağlayan bir parametre bu bağlamda Optimizayon un ilk bacağı olarak satır başına düşen yüksek lojik okuma sayılarına neden olan sorgulara odaklanabiliriz.
  4. Logical Reads, overall Resource consumption bağlamında isabetli tahoracleminlemeler yapmamıza olanak sağlayan bir parametre bu bağlamda Optimizayon un ilk bacağı olarak satır başına düşen yüksek lojik okuma sayılarına neden olan sorgulara odaklanabiliriz. ALTER SESSION SET STATISTICS_LEVEL = ALL; select * from HR.COUNTRIES SELECT plan_table_output FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,'RUNSTATS_LAST'));
  5. Logical Reads: Access pathlerden hangileri daha az logical read yapar. Selectivity doğru access path’i seçmek için çok önemlidir.
  6. Selectivity’nin yüksek olduğu durumda tablo datasının büyük bir bölümünün getirileceği düşünülmelidir. Bu bağlamda Full Table Scan karşımıza ilk çıkan veri erişim yöntemidir. Bunun yanı sıra partitioning yaptığımız tablolarda full parttion scans gibi yöntemler ve sadece index okuma gibi yöntemlerde karşımıza çıkabilir.
  7. Full table scans de logical read sayısı, blok sayısına eşit olmuş oluyor.
  8. Selectivitynin çok zayıf olduğu durumlarda full table scan yapmak veriye erişmek için en etkili yöntem ancak selectivitynin düşmeye başladığı durumlarda bir çok blok gereksiz yere okunmaya başlar. Selectivitynin düşük olduğu durumda index kullanmakta efficient bir yöntem değildir. Bu tarz durumlarda logical reads sayısını düşürmek için seçilecek en etkin yöntem partitionlamadır. Optimizer gelen sorguya bakarak ilgili olmayan data barındıran partitionları okumayarak veri erişimini etkin kılar buna partition pruning denir. Range Partition: Doğal olarak sıralı olan durumlarda örneğin belirli bir zaman aralığında öncesinde sonrasında.. List Part. : Distinct değer sayısı limitli olan durumlarda. Örneğin, cinsiyet, status,country,postal_codes gibi Hash Part.:distinct kayıt sayısı çok fazla olan durumlarda kullanılması önerilir. Örneğin customer_id, sales_id ...
  9. Sorgu geldiğinde optimizer where conditionına bakar ve partition keyin join conditionını inceleyerek ilgili datayı hangi partitionda arayacağını data dictionary ye bakarak karar verir ve ilgisi dışında olan partitionları budar (Partition pruning). Partition pruning yapılabilmesi için partition keylerin where koşulunda mutlak suretle olması beklenir aksi takdirde optimizer’ın datanın hangi partitionda aranacağını bilemez ve tüm partitionları tarayarak full table scan yapmak zorunda kalır.
  10. Index ler yalnızca, kendileri üzerinden rowid listesi çıkarıp bu rowidlere karşılık kayıtları bulmak için tablolara gitmezler, indexler doğal olarak tablo üzerindeki bir yada birden çok kolonu key olarak aldıklarından ötürü üzerlerinde key olarak aldığı data yıda barındırmaktadırlar. Eğer gelen sorgunun dönüşü index key’in olduğu kolon ise rowid’yi alıp tabloya gitme gereksinimi kalmadan index keyi okuyup geriye sorgu sonucu olarak döndürebilmektedir. Bu sayede çok önemli bir veri erişim optimizasyonunu oracle kullanıcılarına sağlamaktadır. Eğer index querry nin ihtiyaç duyduğu tüm datayı üzerinde barındırıyorsa, full table scan, full partition scan yerine full index scan yapılarak sorgu sonucu döndürülür. Full index scan, full table ve full partition scana göre çok daha efektif ve az lojik okuma yapan bir yöntemdir. Bunun nedenide index segmentlerinin tablo segmentlerinden daha ufak olmasıdır. Eğer index buffer cache de yoksa, index disk üzerinden getirilmeye başlanır. İndexin büyük olduğu durumlarda okunacak blok sayısı artacağından dolayı daha fazla blok okuması yapılacak. Index full scan yöntemi blokları tek tek okuduğundan toplam blok sayısı, toplam okuma sayısına eşit olucak ve yöntem inefficient hale gelicek. Bu tarz durumlarda multiblock read tekniğini kulnnabilen index_fast_full scan yöntemini gerekli hinti verek kullanmak okuma sayısını düşürüp etkin bir yönteme sistemizmizi tekrar çevirebilir.
  11. Selectivity nin 0 a yakın olduğu durumlar.
  12. Selectivitynin düşük olduğu koşulda en etkili yöntemdir. Belirli bir satıra erişmenin en etkin ve efektif yolu rowid ile erişmektir. Ancak bu etkin yolu kullanabilmek için ilk başta rowid yi çekip saklamak gerekmektedir. Daha sonra bir sonraki aynı satıra erişimizimizde doğrudan kullanabiliyoruz. Eğer bir satıra 2 kez erişiyorsak herhangi bir durum içerisinde burada ilk erişimimizi yaptığımızda rowid yide çekmek bir sonraki erişimimizi en etkin metod ile yapmamız anlamına gelecektir.
  13. Selectivity nin strong olduğu durumlarda en sık kullanılan metodlardan biridir.
  14. Clustering Factor Logical reads sayısını doğrudan etkileyen bir durum.-
  15. Primary key üzerinden yapılmamalıdır. Distinct value değeri sınırlı olan kolonlar üzerinden yapılmalıdır. Cardinalty si düşük bir kolonum varsa ve tablomda çok büyükse, bitmap index btree index e göre daha performanslıdır. Ancak sorguda birden çok or lu and condition ının birleşmesi gerekliki bitmap indexin performansı artsın.
  16. Bitmap index her zaman compress dir. B-tree index ancak istenilirse compress edilir.
  17. Ana fikir tablo segmentlerini okumaktan kaçınmak çünkü index segmentleri tablo segmentlerinden daha küçüktür. Buda daha az lojik okuma yapmamız anlamına gelmektedir. Eğer P.K üzerinden sıkça sorgu yaptığımız bir tablo durumu söz konusu ise ve bu tablodaki data karakteristiği indexli bir şekilde tutulmaya elverişli ise bu tabloyu IOT formatında tutmak performansı artırır. Data hep clustered olarak saklandığından pk üzerinden yapılan range scan sorgulamaları çok efektif ve etkili oluyor. Data primary key üzerinden organize edilmiş bir şekilde tutlduğu için olası bir order by işlemi çok etkin gerçekleşiyor.
  18. Aynı key’e sahip olan tüm kayıtlar disk üzerinde beraber saklanıyorlar. Özellikle eşitlik içeren sorgularda index li erişime göre çok daha etkin ve efektif bir erişim sağlıyorlar. Cluster key üzerinden bir fonksyon sonucunda hash key oluşturuyor ve bu hash key kayıtların disk üzerinde doğrudan nerede olduğunu gösteriyor. Index gibi extra bir veri yapısına ihtiyacı olmadığından extradan fazla okuma yapmıyor. Eğer cluster key üzerinden sık sorgulama sorgulama yapılıyorsa ve sizing doğru bir şekilde yapıldı ise performansı çok iyidir. Cluster key primary key den farklı bir değer olabilir. Hash collision dan kaçınmak için ve boşa diskten yer kaybetmemek için sizing doğru yapıılmalıdır. Partitioning i desteklemez Lob kolonları desteklemez.