Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Opti̇mi̇zi̇ng Data Access

1,163 views

Published on

Opti̇mi̇zi̇ng Data Access

Published in: Data & Analytics
  • Be the first to comment

  • Be the first to like this

Opti̇mi̇zi̇ng Data Access

  1. 1. Emrah METE TURKCELL TEKNOLOJİ OPTIMIZING DATA ACCESS
  2. 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. 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. 4. How to find efficient access path? - Resource Consumption - Efficiency / Speed - Resource Utilization
  5. 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. 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
  7. 7. Logical Reads
  8. 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. 9. Selectivity Selectivity = number of return rows / total rows
  10. 10. SQL Statements with Weak Selectivtiy - Full Table Scans - Full Partition Scans - Full Index Scans
  11. 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. 12. FULL TABLE SCANS Total Rows: 10000 N2=19: 24 Rows Case1: Case2: - Alter Table Enable Row Movement - Alter Table Shrink Space
  13. 13. Partitioning
  14. 14. FULL PARTITION SCANS
  15. 15. FULL INDEX SCANS
  16. 16. SQL Statements with Strong Selectivtiy - Rowid Access - Index Access - Single Table Hash Cluster Access
  17. 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
  18. 18. ROWID ACCESS
  19. 19. INDEX ACCESS - Index accesses are by far the most often used access paths for SQL statements with strong selectivity.
  20. 20. CLUSTERING FACTOR
  21. 21. BITMAP INDEXES
  22. 22. B-TREE vs BITMAP Indexes - Primary Key and Unique Key - Row-Level Locking - Efficient Combination Of Several Indexes - IS NULL Condition - Compression
  23. 23. INDEX ORGANIZED TABLES
  24. 24. SINGLE TABLE HASH CLUSTER ACCESS
  25. 25. SORULAR/YORUMLAR
  26. 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
  27. 27. Teşekkürler

×