Dig into details on how Oracle has implemented Adaptive Cursor Sharing feature to make using bind variables and having optimal plans at each query execution possible
Ukoug15 SIMD outside and inside Oracle 12c (12.1.0.2)Laurent Leturgez
This document discusses SIMD (Single Instruction Multiple Data) instructions both outside and inside Oracle 12c. It provides an overview of SIMD instructions on Intel architectures, how they can improve performance, and how Oracle 12c leverages SIMD registers and instructions for in-memory columnar storage and filtering. The document also discusses how to trace SIMD instruction usage inside Oracle using tools like gdb and systemtap.
This document discusses different types of enqueue waits caused by locks in an Oracle database. It covers common lock names like TX, TM, and UL; lock modes like exclusive and share; and how to identify the waiter, blocker, lock type, and object being blocked using views like v$lock, v$session, and v$active_session_history. The key pieces of information needed to resolve lock waits are the session ID of the waiter, the lock mode, and the object being blocked. User locks like TX and TM locks result from transactions and table modifications, while internal locks govern objects like redo and reusable objects.
The document discusses optimization of Real Application Clusters (RAC) in Oracle 12c. It provides background on the author and outlines common root causes of RAC performance issues such as CPU/memory starvation, network issues, and excessive dynamic remastering. The document then presents golden rules for RAC diagnostics including avoiding focusing only on top wait events, eliminating infrastructure issues, identifying problem instances, examining both send and receive side metrics, and using histograms. Specific techniques are described for analyzing wait events like gc buffer busy.
Understanding Query Optimization with ‘regular’ and ‘Exadata’ OracleGuatemala User Group
The document discusses query optimization with regular Oracle databases and Exadata databases. It explains what happens when a SQL statement is issued, including parsing, optimization, and execution. It describes what an execution plan is and how it can be generated and displayed. It discusses how operations can be offloaded to storage cells on Exadata and factors the optimizer considers for determining a good execution plan.
Ash masters : advanced ash analytics on Oracle Kyle Hailey
The document discusses database performance tuning. It recommends using Active Session History (ASH) and sampling sessions to identify the root causes of performance issues like buffer busy waits. ASH provides key details on sessions, SQL statements, wait events, and durations to understand top resource consumers. Counting rows in ASH approximates time spent and is important for analysis. Sampling sessions in real-time can provide the SQL, objects, and blocking sessions involved in issues like buffer busy waits.
This document discusses using Active Session History (ASH) to analyze and troubleshoot performance issues in an Oracle database. It provides an example of using ASH to identify the top CPU-consuming session over the last 5 minutes. It shows how to group and count ASH data to calculate metrics like average active sessions (AAS) and percentage of time spent on CPU. The document also discusses using ASH to identify top waiting sessions and analyze specific wait events like buffer busy waits.
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Alex Zaballa
Oracle Database 12c includes many new tuning features for developers and DBAs. Some key features include:
- Multitenant architecture allows multiple pluggable databases to consolidate workloads on a single database instance for improved utilization and administration.
- In-memory column store enables real-time analytics on frequently accessed data held entirely in memory for faster performance.
- New SQL syntax like FETCH FIRST for row limiting and offsetting provides more readable and intuitive replacements for previous techniques.
- Adaptive query optimization allows queries to utilize different execution plans like switching between nested loops and hash joins based on runtime statistics for improved performance.
This document discusses various types of enqueue waits in Oracle related to locks, including row locks, transaction locks, and table modification locks. It provides examples of how to interpret the lock type and mode from the event and parameter values seen in wait events. It also demonstrates how to use Active Session History, logminer, and other views to identify the blocking session, lock details, and blocking SQL associated with enqueue waits.
Mark Farnam : Minimizing the Concurrency Footprint of TransactionsKyle Hailey
The document discusses minimizing the concurrency footprint of transactions by using packaged procedures. It recommends instrumenting all code, including PL/SQL, for performance monitoring. It provides examples of submitting trivial transactions using different methods like sending code from the client, sending a PL/SQL block, or calling a stored procedure. Calling a stored procedure is preferred as it avoids re-parsing and re-sending code and allows instrumentation to be added without extra network traffic.
DBA Commands and Concepts That Every Developer Should KnowAlex Zaballa
DBA Commands and Concepts That Every Developer Should Know was presented by Alex Zaballa, an Oracle DBA with experience in Brazil and Angola. The presentation covered Oracle Flashback Query, Flashback Table, RMAN table recovery, pending statistics, explain plan, DBMS_APPLICATION_INFO, row-by-row vs bulk processing, Virtual Private Database, extended data types, SQL text expansion, identity columns, UTL_CALL_STACK, READ privileges vs SELECT privileges, and online table redefinition. The presentation included demonstrations of many of these concepts.
Flex Cluster e Flex ASM - GUOB Tech Day - OTN TOUR LA Brazil 2014Alex Zaballa
The document discusses Oracle Flex Cluster and Flex ASM configurations. A Flex Cluster allows running Oracle databases on hub and leaf nodes, where leaf nodes do not require direct access to storage. It also discusses converting existing clusters to Flex Clusters and Flex ASM. Key aspects covered include the use of Grid Naming Service for Flex Clusters, capabilities of hub and leaf nodes, and enhancements in Flex ASM such as larger LUN size support and password file storage in ASM.
Kyle Hailey is an Oracle expert who has worked with Oracle since 1990. He has experience with Oracle support, porting versions of Oracle, benchmarking, and real world performance. He has also worked with startups, Quest Software, Oracle OEM, and Embarcadero. The document discusses row locks in Oracle and how to find blocking sessions and SQL using tools like ASH, v$lock, and Logminer. It provides examples of creating row lock waits and how to investigate them using these tools.
This document discusses indexing in Oracle Exadata. It begins by providing background on the speaker and their experience. It then discusses how Exadata storage server software, including hybrid columnar compression and smart flash cache, can accelerate queries. The document shows an example of how a query that previously took minutes can take seconds on Exadata due to smart scans. It discusses how indexes may no longer provide benefits and can even reduce performance on Exadata. The document considers whether indexes should be dropped or if the decision is more complex. It analyzes the costs of using indexes versus full table scans on Exadata. Finally, it provides examples to illustrate smart scans.
Profiling the logwriter and database writerKyle Hailey
The document discusses the behavior of the Oracle log writer (LGWR) process under different conditions. In idle mode, LGWR sleeps for 3 seconds at a time on a semaphore without writing to the redo log buffer. When a transaction is committed, LGWR may write the committed redo entries to disk either before or after the foreground process waits on a "log file sync" event, depending on whether LGWR has already flushed the data. The document also compares the "post-wait" and "polling" modes used for the log file sync wait.
Troubleshooting Complex Oracle Performance Problems with Tanel PoderTanel Poder
The document describes troubleshooting a performance issue involving parallel data loads into a data warehouse. It is determined that the slowness is due to recursive locking and buffer busy waits occurring during inserts into the SEG$ table as new segments are created by parallel CREATE TABLE AS SELECT statements. This is causing a nested locking ping-pong effect between the cache, transaction, and I/O layers as sessions repeatedly acquire and release locks and buffers.
The document discusses 12 enhancements to wait event monitoring and analysis in Oracle 10g, including more descriptive wait event names, new columns in views like v$session and v$sqlarea, and new views such as v$event_histogram and v$session_wait_history that provide additional insight. It focuses on improvements that help DBAs more easily understand what sessions are waiting for and identify potential performance bottlenecks through better organized wait event classification and more granular wait time statistics.
This document provides an introduction to using the GNU debugger (GDB) for profiling C function sequences in Oracle databases. It discusses how GDB can be used to attach to running Oracle processes and set breakpoints to pause execution when specific functions are entered. This allows analyzing function call flows and identifying performance bottlenecks. The document also covers limitations of using GDB due to Oracle binaries not containing debug symbols and being dynamically linked.
Tuning SQL for Oracle Exadata: The Good, The Bad, and The Ugly Tuning SQL fo...Enkitec
This document discusses tuning SQL on Oracle Exadata. It makes three main points:
1. Gathering and displaying execution plan data differs slightly on Exadata compared to non-Exadata databases.
2. The general approach to optimization is similar to non-Exadata, focusing on features like smart scans, storage indexes, and parallelism that provide the most benefit.
3. Rewriting SQL queries can have a dramatic impact on performance by enabling offloading and reducing disk I/O, with examples showing savings of over 98% in run time.
In Memory Database In Action by Tanel Poder and Kerry OsborneEnkitec
The document discusses Oracle Database In-Memory option and how it improves performance of data retrieval and processing queries. It provides examples of running a simple aggregation query with and without various performance features like In-Memory, vector processing and bloom filters enabled. Enabling these features reduces query elapsed time from 17 seconds to just 3 seconds by minimizing disk I/O and leveraging CPU optimizations like SIMD vector processing.
This document discusses plan stability in Oracle databases and different techniques for stabilizing query plans. It begins by defining plan flexibility and stability, and describes why plans may perform inconsistently or "flip" between different executions. The document then covers various Oracle features for improving plan flexibility like SQL profiles and improving plan stability like hints, stored outlines, and SQL plan management. It provides an example of using SQL profiles and Automatic Workload Repository data to capture and apply a previously high-performing plan to stabilize a query that saw performance degradation after an upgrade.
The document discusses new features in Oracle Database 11g Release 1. Key points include:
1. Encrypted tablespaces allow encryption of data at the tablespace level while still supporting indexing and queries.
2. New caching capabilities improve performance by caching more results in memory, such as function results and query results.
3. Standby databases have enhanced capabilities and can now be used for more active purposes like development, testing and reporting for increased usability and value.
Create your oracle_apps_r12_lab_with_less_than_us1000Ajith Narayanan
This document summarizes a presentation on how to create an Oracle Apps R12 lab with less than $1000. It discusses designing a multi-tier architecture for Oracle Apps R12 on a Linux platform using inexpensive hardware. Specifically, it describes how to set up 5 Dell desktops running Oracle Linux and connected via switches to act as nodes, with a NAS storage device providing shared storage between the nodes. Software components like Oracle Grid Infrastructure, Oracle Database, and Oracle E-Business Suite can then be installed to implement the multi-tier RAC configuration. The presentation provides step-by-step instructions for tasks like preparing the shared storage, installing the various Oracle software components, and configuring the applications tier to use the RAC database.
How oracle 12c flexes its muscles against oracle 11g r2 finalAjith Narayanan
The document summarizes the new high availability features introduced in Oracle 12c, including Flex Cluster and Flex ASM. A Flex Cluster allows for hub and leaf nodes, where leaf nodes do not require direct access to shared storage. Flex ASM runs Automatic Storage Management (ASM) on fewer nodes, allows for larger disk groups, and isolates ASM traffic to improve performance. The new features provide more flexibility, scalability and ease of management for high availability.
This document provides information about Pythian, a company that provides database management and consulting services. It begins by introducing the presenter, Christo Kutrovsky, and his background. It then provides details about Pythian, including that it was founded in 1997, has over 200 employees, 200 customers worldwide, and 5 offices globally. It notes Pythian's partnerships and awards. The document emphasizes Pythian's expertise in Oracle, SQL Server, and other technologies. It positions Pythian as a recognized leader in database management.
The document discusses techniques for analyzing SQL performance on Oracle Exadata systems using tools like ASH, SQL monitoring, and ExaSnapper. It provides examples of using these tools to identify SQL statements that are not optimized for Exadata's Smart Scan feature and determining if problematic statements are long-running queries or frequent short queries. The document also demonstrates how to selectively force full table scans for reporting workloads while keeping indexes available for OLTP workloads.
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 2Tanel Poder
This document summarizes a series of performance issues seen by the author in their work with Oracle Exadata systems. It describes random session hangs occurring across several minutes, with long transaction locks and I/O waits seen. Analysis of AWR reports and blocking trees revealed that many sessions were blocked waiting on I/O, though initial I/O metrics from the OS did not show issues. Further analysis using ASH activity breakdowns and OS tools like sar and vmstat found high apparent CPU usage in ASH that was not reflected in actual low CPU load on the system. This discrepancy was due to the way ASH attributes non-waiting time to CPU. The root cause remained unclear.
The document provides an overview of Oracle indexes from a conceptual and internal perspective. It discusses B-tree indexes, including their structure, leaf and branch nodes, and how select, update, delete and insert operations are handled internally. It also covers bitmap indexes and their storage format, as well as function-based and reversed indexes.
This document contains a practice exam for the Oracle Exadata Database Machine 2014 Implementation Essentials certification (exam 1Z0-485). It includes 21 multiple choice questions about configuring and implementing Exadata, with explanations provided for each answer. Key topics covered include Exadata networking, storage configuration, cell offloading, I/O resource management, backups, health checks, and integrating Exadata with Enterprise Manager.
O documento resume os benefícios e serviços oferecidos por um cruzeiro fluvial de luxo pela Uniworld. O cruzeiro oferece cabines luxuosas, refeições de qualidade, programações culturais, passeios exclusivos e atividades como ioga e personal trainer. A Uniworld possui uma frota de 17 navios que navegam por diversas partes do mundo com altos níveis de satisfação entre os clientes.
Virtual City Company Profile 26 July VC HighlightsVirtualCityKe
Virtual City is a technology firm that develops mobile solutions for the agriculture and supply chain sectors in Africa. It provides digital tools to increase financial inclusion for farmers and reduce risks for financial service providers. The document outlines Virtual City's solutions which include collateral management, distribution services, productivity reporting, brokerage solutions, and financial systems. The goal is to increase efficiency, visibility, and transparency across supply chains in Kenya, Uganda, Rwanda, Tanzania and 20 more African countries over the next 5 years.
Mark Farnam : Minimizing the Concurrency Footprint of TransactionsKyle Hailey
The document discusses minimizing the concurrency footprint of transactions by using packaged procedures. It recommends instrumenting all code, including PL/SQL, for performance monitoring. It provides examples of submitting trivial transactions using different methods like sending code from the client, sending a PL/SQL block, or calling a stored procedure. Calling a stored procedure is preferred as it avoids re-parsing and re-sending code and allows instrumentation to be added without extra network traffic.
DBA Commands and Concepts That Every Developer Should KnowAlex Zaballa
DBA Commands and Concepts That Every Developer Should Know was presented by Alex Zaballa, an Oracle DBA with experience in Brazil and Angola. The presentation covered Oracle Flashback Query, Flashback Table, RMAN table recovery, pending statistics, explain plan, DBMS_APPLICATION_INFO, row-by-row vs bulk processing, Virtual Private Database, extended data types, SQL text expansion, identity columns, UTL_CALL_STACK, READ privileges vs SELECT privileges, and online table redefinition. The presentation included demonstrations of many of these concepts.
Flex Cluster e Flex ASM - GUOB Tech Day - OTN TOUR LA Brazil 2014Alex Zaballa
The document discusses Oracle Flex Cluster and Flex ASM configurations. A Flex Cluster allows running Oracle databases on hub and leaf nodes, where leaf nodes do not require direct access to storage. It also discusses converting existing clusters to Flex Clusters and Flex ASM. Key aspects covered include the use of Grid Naming Service for Flex Clusters, capabilities of hub and leaf nodes, and enhancements in Flex ASM such as larger LUN size support and password file storage in ASM.
Kyle Hailey is an Oracle expert who has worked with Oracle since 1990. He has experience with Oracle support, porting versions of Oracle, benchmarking, and real world performance. He has also worked with startups, Quest Software, Oracle OEM, and Embarcadero. The document discusses row locks in Oracle and how to find blocking sessions and SQL using tools like ASH, v$lock, and Logminer. It provides examples of creating row lock waits and how to investigate them using these tools.
This document discusses indexing in Oracle Exadata. It begins by providing background on the speaker and their experience. It then discusses how Exadata storage server software, including hybrid columnar compression and smart flash cache, can accelerate queries. The document shows an example of how a query that previously took minutes can take seconds on Exadata due to smart scans. It discusses how indexes may no longer provide benefits and can even reduce performance on Exadata. The document considers whether indexes should be dropped or if the decision is more complex. It analyzes the costs of using indexes versus full table scans on Exadata. Finally, it provides examples to illustrate smart scans.
Profiling the logwriter and database writerKyle Hailey
The document discusses the behavior of the Oracle log writer (LGWR) process under different conditions. In idle mode, LGWR sleeps for 3 seconds at a time on a semaphore without writing to the redo log buffer. When a transaction is committed, LGWR may write the committed redo entries to disk either before or after the foreground process waits on a "log file sync" event, depending on whether LGWR has already flushed the data. The document also compares the "post-wait" and "polling" modes used for the log file sync wait.
Troubleshooting Complex Oracle Performance Problems with Tanel PoderTanel Poder
The document describes troubleshooting a performance issue involving parallel data loads into a data warehouse. It is determined that the slowness is due to recursive locking and buffer busy waits occurring during inserts into the SEG$ table as new segments are created by parallel CREATE TABLE AS SELECT statements. This is causing a nested locking ping-pong effect between the cache, transaction, and I/O layers as sessions repeatedly acquire and release locks and buffers.
The document discusses 12 enhancements to wait event monitoring and analysis in Oracle 10g, including more descriptive wait event names, new columns in views like v$session and v$sqlarea, and new views such as v$event_histogram and v$session_wait_history that provide additional insight. It focuses on improvements that help DBAs more easily understand what sessions are waiting for and identify potential performance bottlenecks through better organized wait event classification and more granular wait time statistics.
This document provides an introduction to using the GNU debugger (GDB) for profiling C function sequences in Oracle databases. It discusses how GDB can be used to attach to running Oracle processes and set breakpoints to pause execution when specific functions are entered. This allows analyzing function call flows and identifying performance bottlenecks. The document also covers limitations of using GDB due to Oracle binaries not containing debug symbols and being dynamically linked.
Tuning SQL for Oracle Exadata: The Good, The Bad, and The Ugly Tuning SQL fo...Enkitec
This document discusses tuning SQL on Oracle Exadata. It makes three main points:
1. Gathering and displaying execution plan data differs slightly on Exadata compared to non-Exadata databases.
2. The general approach to optimization is similar to non-Exadata, focusing on features like smart scans, storage indexes, and parallelism that provide the most benefit.
3. Rewriting SQL queries can have a dramatic impact on performance by enabling offloading and reducing disk I/O, with examples showing savings of over 98% in run time.
In Memory Database In Action by Tanel Poder and Kerry OsborneEnkitec
The document discusses Oracle Database In-Memory option and how it improves performance of data retrieval and processing queries. It provides examples of running a simple aggregation query with and without various performance features like In-Memory, vector processing and bloom filters enabled. Enabling these features reduces query elapsed time from 17 seconds to just 3 seconds by minimizing disk I/O and leveraging CPU optimizations like SIMD vector processing.
This document discusses plan stability in Oracle databases and different techniques for stabilizing query plans. It begins by defining plan flexibility and stability, and describes why plans may perform inconsistently or "flip" between different executions. The document then covers various Oracle features for improving plan flexibility like SQL profiles and improving plan stability like hints, stored outlines, and SQL plan management. It provides an example of using SQL profiles and Automatic Workload Repository data to capture and apply a previously high-performing plan to stabilize a query that saw performance degradation after an upgrade.
The document discusses new features in Oracle Database 11g Release 1. Key points include:
1. Encrypted tablespaces allow encryption of data at the tablespace level while still supporting indexing and queries.
2. New caching capabilities improve performance by caching more results in memory, such as function results and query results.
3. Standby databases have enhanced capabilities and can now be used for more active purposes like development, testing and reporting for increased usability and value.
Create your oracle_apps_r12_lab_with_less_than_us1000Ajith Narayanan
This document summarizes a presentation on how to create an Oracle Apps R12 lab with less than $1000. It discusses designing a multi-tier architecture for Oracle Apps R12 on a Linux platform using inexpensive hardware. Specifically, it describes how to set up 5 Dell desktops running Oracle Linux and connected via switches to act as nodes, with a NAS storage device providing shared storage between the nodes. Software components like Oracle Grid Infrastructure, Oracle Database, and Oracle E-Business Suite can then be installed to implement the multi-tier RAC configuration. The presentation provides step-by-step instructions for tasks like preparing the shared storage, installing the various Oracle software components, and configuring the applications tier to use the RAC database.
How oracle 12c flexes its muscles against oracle 11g r2 finalAjith Narayanan
The document summarizes the new high availability features introduced in Oracle 12c, including Flex Cluster and Flex ASM. A Flex Cluster allows for hub and leaf nodes, where leaf nodes do not require direct access to shared storage. Flex ASM runs Automatic Storage Management (ASM) on fewer nodes, allows for larger disk groups, and isolates ASM traffic to improve performance. The new features provide more flexibility, scalability and ease of management for high availability.
This document provides information about Pythian, a company that provides database management and consulting services. It begins by introducing the presenter, Christo Kutrovsky, and his background. It then provides details about Pythian, including that it was founded in 1997, has over 200 employees, 200 customers worldwide, and 5 offices globally. It notes Pythian's partnerships and awards. The document emphasizes Pythian's expertise in Oracle, SQL Server, and other technologies. It positions Pythian as a recognized leader in database management.
The document discusses techniques for analyzing SQL performance on Oracle Exadata systems using tools like ASH, SQL monitoring, and ExaSnapper. It provides examples of using these tools to identify SQL statements that are not optimized for Exadata's Smart Scan feature and determining if problematic statements are long-running queries or frequent short queries. The document also demonstrates how to selectively force full table scans for reporting workloads while keeping indexes available for OLTP workloads.
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 2Tanel Poder
This document summarizes a series of performance issues seen by the author in their work with Oracle Exadata systems. It describes random session hangs occurring across several minutes, with long transaction locks and I/O waits seen. Analysis of AWR reports and blocking trees revealed that many sessions were blocked waiting on I/O, though initial I/O metrics from the OS did not show issues. Further analysis using ASH activity breakdowns and OS tools like sar and vmstat found high apparent CPU usage in ASH that was not reflected in actual low CPU load on the system. This discrepancy was due to the way ASH attributes non-waiting time to CPU. The root cause remained unclear.
The document provides an overview of Oracle indexes from a conceptual and internal perspective. It discusses B-tree indexes, including their structure, leaf and branch nodes, and how select, update, delete and insert operations are handled internally. It also covers bitmap indexes and their storage format, as well as function-based and reversed indexes.
This document contains a practice exam for the Oracle Exadata Database Machine 2014 Implementation Essentials certification (exam 1Z0-485). It includes 21 multiple choice questions about configuring and implementing Exadata, with explanations provided for each answer. Key topics covered include Exadata networking, storage configuration, cell offloading, I/O resource management, backups, health checks, and integrating Exadata with Enterprise Manager.
O documento resume os benefícios e serviços oferecidos por um cruzeiro fluvial de luxo pela Uniworld. O cruzeiro oferece cabines luxuosas, refeições de qualidade, programações culturais, passeios exclusivos e atividades como ioga e personal trainer. A Uniworld possui uma frota de 17 navios que navegam por diversas partes do mundo com altos níveis de satisfação entre os clientes.
Virtual City Company Profile 26 July VC HighlightsVirtualCityKe
Virtual City is a technology firm that develops mobile solutions for the agriculture and supply chain sectors in Africa. It provides digital tools to increase financial inclusion for farmers and reduce risks for financial service providers. The document outlines Virtual City's solutions which include collateral management, distribution services, productivity reporting, brokerage solutions, and financial systems. The goal is to increase efficiency, visibility, and transparency across supply chains in Kenya, Uganda, Rwanda, Tanzania and 20 more African countries over the next 5 years.
El documento describe las características de la Web 2.0, la cual se enfoca en facilitar la máxima interacción entre usuarios a través de redes sociales. La Web 2.0 se caracteriza por ser altamente interactiva y dinámica, permitiendo la participación y colaboración de los usuarios. Entre las herramientas clave de la Web 2.0 se encuentran Google, blogs, redes sociales y YouTube.
El aprendizaje virtual es una forma de adquirir conocimiento mediante el uso de tecnologías de la información educativas, las cuales actúan como intermediarias entre la interacción alumno-docente y alumno-alumno. El aprendizaje virtual permite al alumno ser responsable de su propio aprendizaje y adaptarlo a su horario y ubicación geográfica, mediado por la computadora y disponible en cualquier momento. Requiere que el docente propicie la interacción entre participantes y el material digital, y que cuide la cal
Farm Africa has received a new £3 million grant from the UK Government, through the FoodTrade East and Southern Africa trade enhancement and promotion programme.
There are many different music genres that classify types of music according to their purpose. The main genres include vocal music, performed by singers with or without instruments; instrumental music, played only with instruments; and vocal and instrumental combined genres. Other genres are religious music for religious contexts, both liturgical and non-liturgical; profane genres for entertainment without religious purpose like popular, cultured, and folk music; and functional genres that provide background music for events.
Du Yaqiong has over 5 years of work experience in human resources, entrepreneurship, and legal work. She holds a Master's degree in MBA and has worked for both private companies and local government. Her experience includes founding two small businesses, holding human resources roles, and conducting research on business strategy and Chinese market trends. She is seeking new opportunities that utilize her skills in management, marketing, law, and cross-cultural business operations.
Este documento resume varias herramientas web como Slideshare (una plataforma para compartir presentaciones), PDF (un formato de archivo propietario de Adobe), canales de YouTube (donde los usuarios pueden subir videos y suscribirse a otros canales) y las nuevas funciones de edición de video en YouTube.
Continuous improvement is important for any organization to succeed. A quiz is provided to test understanding of continuous improvement principles like establishing a vision, engaging employees, measuring performance, identifying issues, testing solutions, and institutionalizing improvements. Answering the quiz questions correctly demonstrates knowledge of how to continuously improve processes within an organization.
GEODI : a Practical Information Management Solution For Construction Sectorserdarak2
GEODI is an Innovative Solution which reads and Interprets any kind of content from many different sources by using Natural Language Processing and Machine Learning.
Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...Carlos Sierra
Adaptive Cursor Sharing (ACS) is a feature available since 11g. It is enabled by default. ACS can help to generate multiple non-persistent Optimal Execution Plans for a given SQL. But it requires a sequence of events for it to get truly activated. This presentation describes what is ACS, when it is used and when it is not. Then it demonstrates ACS capabilities and limitations with a live demo.
This session is about: How Adaptive Cursor Sharing (ACS) actually works. How a bind sensitive cursor becomes bind aware. What are those "ACS buckets". How the "Selectivity Profile" works. Why sometimes your SQL becomes bind aware and why sometimes it does not. How is that ACS interacts with SQL Plan Management (SPM). These and other questions about ACS are answered in detail.
Some live demonstrations are used to illustrate the ramp-up process on ACS and how some child cursors are created then flagged as non-shareable. You will also "see" how the ACS Selectivity Profile is adapted as new executions make use of predicates with new Selectivities. ACS promotes Plan Flexibility while SPM promotes Plan Stability. Understanding how these duo interacts becomes of great value when some gentle intervention is needed to restore this delicate balance.
This session is for those Developers and DBAs that "need" to understand how things work. ACS can be seen as a back-box; or you can "look" inside and understand how it actually works. If you are curious about the ACS functionality, then this Session brings some light. Consider this session only if you are pretty familiar with Cursor Sharing, Binds, Plan Stability and Plan Flexibility.
El documento presenta un resumen de las principales teorías del comercio internacional. Comienza con las teorías preclásicas como el mercantilismo y los fisiócratas. Luego pasa a describir las teorías clásicas de Adam Smith, David Ricardo y John Stuart Mill. Más adelante se detalla a los neoclásicos y postclásicos como Keynes. Finalmente menciona brevemente las teorías marxistas y algunas teorías alternativas como la disponibilidad y el ciclo del producto.
Managing Statistics for Optimal Query PerformanceKaren Morton
Half the battle of writing good SQL is in understanding how the Oracle query optimizer analyzes your code and applies statistics in order to derive the “best” execution plan. The other half of the battle is successfully applying that knowledge to the databases that you manage. The optimizer uses statistics as input to develop query execution plans, and so these statistics are the foundation of good plans. If the statistics supplied aren’t representative of your actual data, you can expect bad plans. However, if the statistics are representative of your data, then the optimizer will probably choose an optimal plan.
The document discusses virtual indexes and columns in Oracle. Virtual indexes do not require disk space and time for creation like physical indexes. They can be used to test query execution plans without impacting the system. The document shows how to create a virtual index on the NO_FISICO column of the MOVTO_H table and use it to improve a query. It also discusses calculating statistics for a virtual index and using virtual columns to add calculated or derived columns to a table without changing the table definition.
SQL Macros - Game Changing Feature for SQL Developers?Andrej Pashchenko
SQL Macros are functions that return SQL statements as text. When called in a SQL statement, the returned SQL text is parsed and optimized rather than executing the function at runtime. This avoids context switches to PL/SQL and allows the optimizer to see the full SQL. Table SQL macros can be called in the FROM clause and act like views or inline queries, except they allow parameters to make the views polymorphic. Scalar parameters in the returned SQL text are substituted like bind variables to make the macros more reusable and flexible.
The document summarizes how SQL Plan Directives in Oracle 12c can help address issues caused by cardinality misestimation in the optimizer. It provides an example where the optimizer underestimates the number of rows returned by a query on a table due to not having statistics on correlated columns. In 12c, a SQL Plan Directive is automatically generated after the first execution to capture this misestimation. On subsequent queries, the directive can be used to provide more accurate cardinality estimates through automatic reoptimization or dynamic sampling.
This document discusses features of Oracle Database 12c related to auditing and tracking changes over time. It summarizes that Oracle 12c includes flashback data archive, which allows viewing or restoring data to a previous state. This feature can be used for auditing and tracking changes made to database tables. The document also discusses how Oracle 12c captures additional context metadata with each change, including user, host, and program used, allowing more detailed tracking of changes than prior releases.
This document provides examples of using different format parameters with the DBMS_XPLAN.DISPLAY_CURSOR procedure to customize the output. Key information displayed includes execution statistics, predicates, projections, outlines, and indications of adaptive plans.
SQL Plan Management with Oracle Database provides tools to manage SQL performance and stability. It includes SQL profiles, stored outlines, SQL patches, and SQL baselines that can capture and enforce execution plans. New features in Oracle 12c include adaptive plans, which automatically choose join methods and parallel distribution, as well as adaptive statistics using dynamic sampling to improve cardinality estimates. Bind variable peeking and cardinality feedback also help the optimizer select optimal plans.
This document discusses various Oracle SQL concepts including query optimization, execution plans, joins, indexes, and full table scans. It provides guidance on understanding how Oracle processes and executes SQL queries, the importance of statistics and selectivity, and techniques for writing efficient queries such as predicate pushing and query transformations. The goal is to help readers gain a conceptual understanding of Oracle's internals to formulate more efficient SQL.
The document discusses several new features and enhancements in Oracle Database 11g Release 1. Key points include:
1) Encrypted tablespaces allow full encryption of data while maintaining functionality like indexing and foreign keys.
2) New caching capabilities improve performance by caching more results and metadata to avoid repeat work.
3) Standby databases have been enhanced and can now be used for more active purposes like development, testing, reporting and backups while still providing zero data loss protection.
A few things about the Oracle optimizer - 2013Connor McDonald
The document discusses how using the wrong data types for columns in a database table can negatively impact performance and data integrity. It shows examples of creating a table with date, string, and number columns using implicit data type conversions and the problems this causes for indexing, statistics gathering, and query optimization. Maintaining the correct data types is important for the optimizer to choose efficient execution plans and for the database to properly enforce data constraints.
The document discusses several topics related to SQL:
1) SQLNet compression - How ordering data in a query can significantly reduce the amount of data sent over the network by compressing repeated values. Ordering by additional columns further improves compression.
2) NULLs and indexes - There is a misconception that indexes cannot be used with queries involving NULL values, but indexes can support queries searching for NULL values.
3) Subquery caching - Repeated scalar subqueries are cached and evaluated only once to improve performance of queries containing subqueries.
This document provides an introduction to cost based optimization. It discusses key concepts like selectivity, cardinality, histograms, and correlation issues. The author is Riyaj Shamsudeen, an Oracle expert with 18 years of experience. Sample code and examples are provided to illustrate how to calculate selectivity and cardinality accurately to improve query optimization. Extended statistics are highlighted as a way to address correlation between column predicates in Oracle 11g and above.
Dbms plan - A swiss army knife for performance engineersRiyaj Shamsudeen
This document discusses dbms_xplan, a tool for performance engineers to analyze execution plans. It provides options for displaying plans from the plan table, shared SQL area in memory, and AWR history. Dbms_xplan provides more detailed information than traditional tools like tkprof, including predicates, notes, bind values, and plan history. It requires privileges to access dictionary views for displaying plans from memory and AWR. The document also demonstrates usage examples and output formats for dbms_xplan.analyze.
The document contains SQL statements and execution plans for counting records in a table where the ID is between 1 and 10 and the status is either '00' or '01'. It shows that for a status of '00' there are 10000 records, but for a status of '01' there are 0 records. Execution plans and statistics are provided with each statement to analyze the performance and resource usage.
The document describes evolving execution plans in Oracle using SQL plan baselines. It shows capturing an initial plan, creating an index, capturing a new plan, and then evolving the new plan by creating an evolve task, executing it, and accepting the better plan found by the evolve process. Key steps include turning on plan capture, checking captured plans, getting execution plans, creating an index, checking for new plans, creating and running an evolve task, and accepting the recommended plan.
This paper describes the evolution of the Plan table and DBMSX_PLAN in 11g and some of the features that can be used to troubelshoot SQL performance effectively and efficiently.
Company ABC was experiencing slow performance from a SQL query that ran frequently. The DBA team identified that the query joined two tables on an object ID where the object type of 'JOB' was very low compared to the overall table sizes. The DBA team proposed two solutions to improve query performance without changing the application code: 1) Create indexes on the object type columns and remove hints from the SQL, and 2) Create materialized views on the tables filtered on object type and enable query rewrite. Both solutions resulted in faster query execution times by reducing the number of rows accessed.
The document describes linking and accelerating programs in the TNS/E environment. It discusses using the eld linker to link multiple modules into an executable, how to handle unresolved symbols, and how to create dynamic link libraries (DLLs). It also covers using the Object Code Accelerator (OCA) to optimize Guardian code files for the Itanium architecture, and tools like enoft and fileinfo for examining object files and determining if a program has been accelerated.
Mobile App Development Company in Saudi ArabiaSteve Jonas
EmizenTech is a globally recognized software development company, proudly serving businesses since 2013. With over 11+ years of industry experience and a team of 200+ skilled professionals, we have successfully delivered 1200+ projects across various sectors. As a leading Mobile App Development Company In Saudi Arabia we offer end-to-end solutions for iOS, Android, and cross-platform applications. Our apps are known for their user-friendly interfaces, scalability, high performance, and strong security features. We tailor each mobile application to meet the unique needs of different industries, ensuring a seamless user experience. EmizenTech is committed to turning your vision into a powerful digital product that drives growth, innovation, and long-term success in the competitive mobile landscape of Saudi Arabia.
Semantic Cultivators : The Critical Future Role to Enable AIartmondano
By 2026, AI agents will consume 10x more enterprise data than humans, but with none of the contextual understanding that prevents catastrophic misinterpretations.
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul
Artificial intelligence is changing how businesses operate. Companies are using AI agents to automate tasks, reduce time spent on repetitive work, and focus more on high-value activities. Noah Loul, an AI strategist and entrepreneur, has helped dozens of companies streamline their operations using smart automation. He believes AI agents aren't just tools—they're workers that take on repeatable tasks so your human team can focus on what matters. If you want to reduce time waste and increase output, AI agents are the next move.
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025BookNet Canada
Book industry standards are evolving rapidly. In the first part of this session, we’ll share an overview of key developments from 2024 and the early months of 2025. Then, BookNet’s resident standards expert, Tom Richardson, and CEO, Lauren Stewart, have a forward-looking conversation about what’s next.
Link to recording, transcript, and accompanying resource: https://bnctechforum.ca/sessions/standardsgoals-for-2025-standards-certification-roundup/
Presented by BookNet Canada on May 6, 2025 with support from the Department of Canadian Heritage.
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...Alan Dix
Talk at the final event of Data Fusion Dynamics: A Collaborative UK-Saudi Initiative in Cybersecurity and Artificial Intelligence funded by the British Council UK-Saudi Challenge Fund 2024, Cardiff Metropolitan University, 29th April 2025
https://alandix.com/academic/talks/CMet2025-AI-Changes-Everything/
Is AI just another technology, or does it fundamentally change the way we live and think?
Every technology has a direct impact with micro-ethical consequences, some good, some bad. However more profound are the ways in which some technologies reshape the very fabric of society with macro-ethical impacts. The invention of the stirrup revolutionised mounted combat, but as a side effect gave rise to the feudal system, which still shapes politics today. The internal combustion engine offers personal freedom and creates pollution, but has also transformed the nature of urban planning and international trade. When we look at AI the micro-ethical issues, such as bias, are most obvious, but the macro-ethical challenges may be greater.
At a micro-ethical level AI has the potential to deepen social, ethnic and gender bias, issues I have warned about since the early 1990s! It is also being used increasingly on the battlefield. However, it also offers amazing opportunities in health and educations, as the recent Nobel prizes for the developers of AlphaFold illustrate. More radically, the need to encode ethics acts as a mirror to surface essential ethical problems and conflicts.
At the macro-ethical level, by the early 2000s digital technology had already begun to undermine sovereignty (e.g. gambling), market economics (through network effects and emergent monopolies), and the very meaning of money. Modern AI is the child of big data, big computation and ultimately big business, intensifying the inherent tendency of digital technology to concentrate power. AI is already unravelling the fundamentals of the social, political and economic world around us, but this is a world that needs radical reimagining to overcome the global environmental and human challenges that confront us. Our challenge is whether to let the threads fall as they may, or to use them to weave a better future.
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxAnoop Ashok
In today's fast-paced retail environment, efficiency is key. Every minute counts, and every penny matters. One tool that can significantly boost your store's efficiency is a well-executed planogram. These visual merchandising blueprints not only enhance store layouts but also save time and money in the process.
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfSoftware Company
Explore the benefits and features of advanced logistics management software for businesses in Riyadh. This guide delves into the latest technologies, from real-time tracking and route optimization to warehouse management and inventory control, helping businesses streamline their logistics operations and reduce costs. Learn how implementing the right software solution can enhance efficiency, improve customer satisfaction, and provide a competitive edge in the growing logistics sector of Riyadh.
Spark is a powerhouse for large datasets, but when it comes to smaller data workloads, its overhead can sometimes slow things down. What if you could achieve high performance and efficiency without the need for Spark?
At S&P Global Commodity Insights, having a complete view of global energy and commodities markets enables customers to make data-driven decisions with confidence and create long-term, sustainable value. 🌍
Explore delta-rs + CDC and how these open-source innovations power lightweight, high-performance data applications beyond Spark! 🚀
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell
With expertise in data architecture, performance tracking, and revenue forecasting, Andrew Marnell plays a vital role in aligning business strategies with data insights. Andrew Marnell’s ability to lead cross-functional teams ensures businesses achieve sustainable growth and operational excellence.
How Can I use the AI Hype in my Business Context?Daniel Lehner
𝙄𝙨 𝘼𝙄 𝙟𝙪𝙨𝙩 𝙝𝙮𝙥𝙚? 𝙊𝙧 𝙞𝙨 𝙞𝙩 𝙩𝙝𝙚 𝙜𝙖𝙢𝙚 𝙘𝙝𝙖𝙣𝙜𝙚𝙧 𝙮𝙤𝙪𝙧 𝙗𝙪𝙨𝙞𝙣𝙚𝙨𝙨 𝙣𝙚𝙚𝙙𝙨?
Everyone’s talking about AI but is anyone really using it to create real value?
Most companies want to leverage AI. Few know 𝗵𝗼𝘄.
✅ What exactly should you ask to find real AI opportunities?
✅ Which AI techniques actually fit your business?
✅ Is your data even ready for AI?
If you’re not sure, you’re not alone. This is a condensed version of the slides I presented at a Linkedin webinar for Tecnovy on 28.04.2025.
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Impelsys Inc.
Impelsys provided a robust testing solution, leveraging a risk-based and requirement-mapped approach to validate ICU Connect and CritiXpert. A well-defined test suite was developed to assess data communication, clinical data collection, transformation, and visualization across integrated devices.
AI and Data Privacy in 2025: Global TrendsInData Labs
In this infographic, we explore how businesses can implement effective governance frameworks to address AI data privacy. Understanding it is crucial for developing effective strategies that ensure compliance, safeguard customer trust, and leverage AI responsibly. Equip yourself with insights that can drive informed decision-making and position your organization for success in the future of data privacy.
This infographic contains:
-AI and data privacy: Key findings
-Statistics on AI data privacy in the today’s world
-Tips on how to overcome data privacy challenges
-Benefits of AI data security investments.
Keep up-to-date on how AI is reshaping privacy standards and what this entails for both individuals and organizations.
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxJustin Reock
Building 10x Organizations with Modern Productivity Metrics
10x developers may be a myth, but 10x organizations are very real, as proven by the influential study performed in the 1980s, ‘The Coding War Games.’
Right now, here in early 2025, we seem to be experiencing YAPP (Yet Another Productivity Philosophy), and that philosophy is converging on developer experience. It seems that with every new method we invent for the delivery of products, whether physical or virtual, we reinvent productivity philosophies to go alongside them.
But which of these approaches actually work? DORA? SPACE? DevEx? What should we invest in and create urgency behind today, so that we don’t find ourselves having the same discussion again in a decade?
Dev Dives: Automate and orchestrate your processes with UiPath MaestroUiPathCommunity
This session is designed to equip developers with the skills needed to build mission-critical, end-to-end processes that seamlessly orchestrate agents, people, and robots.
📕 Here's what you can expect:
- Modeling: Build end-to-end processes using BPMN.
- Implementing: Integrate agentic tasks, RPA, APIs, and advanced decisioning into processes.
- Operating: Control process instances with rewind, replay, pause, and stop functions.
- Monitoring: Use dashboards and embedded analytics for real-time insights into process instances.
This webinar is a must-attend for developers looking to enhance their agentic automation skills and orchestrate robust, mission-critical processes.
👨🏫 Speaker:
Andrei Vintila, Principal Product Manager @UiPath
This session streamed live on April 29, 2025, 16:00 CET.
Check out all our upcoming Dev Dives sessions at https://community.uipath.com/dev-dives-automation-developer-2025/.
What is Model Context Protocol(MCP) - The new technology for communication bw...Vishnu Singh Chundawat
The MCP (Model Context Protocol) is a framework designed to manage context and interaction within complex systems. This SlideShare presentation will provide a detailed overview of the MCP Model, its applications, and how it plays a crucial role in improving communication and decision-making in distributed systems. We will explore the key concepts behind the protocol, including the importance of context, data management, and how this model enhances system adaptability and responsiveness. Ideal for software developers, system architects, and IT professionals, this presentation will offer valuable insights into how the MCP Model can streamline workflows, improve efficiency, and create more intuitive systems for a wide range of use cases.
Generative Artificial Intelligence (GenAI) in BusinessDr. Tathagat Varma
My talk for the Indian School of Business (ISB) Emerging Leaders Program Cohort 9. In this talk, I discussed key issues around adoption of GenAI in business - benefits, opportunities and limitations. I also discussed how my research on Theory of Cognitive Chasms helps address some of these issues
Generative Artificial Intelligence (GenAI) in BusinessDr. Tathagat Varma
All on Adaptive and Extended Cursor Sharing
1. 28/11/15 Mohamed Houri www.hourim.wordpress.com
1
Adaptive Cursor Sharing
Short answer to sharing cursors and optimizing SQL
Mohamed Houri
www.hourim.wordpress.com
Mohamed Houri
www.hourim.wordpress.com
2. 28/11/15 Mohamed Houri www.hourim.wordpress.com
2
Agenda
Set the scene
Expose the performance problem caused by sharing cursors
Literal, bind variable, bind variable peeking and hard parsing
Introduce Adaptive Cursor Sharing feature
Adaptive Cursor Sharing
Explain the cursor bind sensitive property
Explain the cursor bind aware property
Show a simple practical ACS example
Explain the ACS monitoring v$sql views
Uncover the bind aware secret sauce
Show how ACS can introduce a serious perfomance issue
Conclusion
3. 28/11/15 Mohamed Houri www.hourim.wordpress.com
3
WHAT IS THE PROBLEM?
PART 0
Set the scene
4. 28/11/15 Mohamed Houri www.hourim.wordpress.com
4
Syntactic check
Syntax, keywords
Semantic check
Access, right, exist Store parent cursor in
v$sql(SGA)
Logical Optimization
Physical Optimization
Store child cursor in
v$sql(SGA)
Parent
cursor?
Child
cursor?
Execute SQL
No
No
Yes
Yes
Set the scene
Hardparse
Softparse
5. 28/11/15 Mohamed Houri www.hourim.wordpress.com
5
Using Literal variable
➔
hard parsing for each execution
➔
traumatizes the SGA
➔
burns a lot CPU
Set the scene
Using bind variables
➔
avoids hard parsing
➔
makes the SGA attractive
➔
uses less resource - CPU
generates “always“ an optimal plan
sharing plan is not always optimal
6. 28/11/15 Mohamed Houri www.hourim.wordpress.com
6
How to have best-of-both-world?
Set the scene
➔ Attractive SGA + less CPU consumption
➔ Optimal execution plan for each execution
Adaptive Cursor Sharing-ACS
10. 28/11/15 Mohamed Houri www.hourim.wordpress.com
10
ACS – model
SQL> create table t_acs(n1 number, n2 number);
SQL> BEGIN
for j in 1..1200150 loop
if j = 1 then
insert into t_acs values (j, 1);
elsif j>1 and j<=101 then
insert into t_acs values(j, 100);
elsif j>101 and j<=1101 then
insert into t_acs values (j, 1000);
elsif j>10001 and j<= 110001 then
insert into t_acs values(j,10000);
else
insert into t_acs values(j, 1000000);
end if;
end loop;
commit;
END;
Inflexion point
Inflexion point
11. 28/11/15 Mohamed Houri www.hourim.wordpress.com
11
ACS – model
SQL> create index t_acs_i1 on t_acs(n2);
SQL> BEGIN
dbms_stats.gather_table_stats
(user
,'t_acs'
,method_opt => 'for all columns size 1'
,cascade => true
,estimate_percent => dbms_stats.auto_sample_size
);
END;
/
–- declare and affect a value to a bind variable
–- and run a query with range predicate
SQL> var ln2 number;
SQL> exec :ln2 := 100;
Without histogram
12. 28/11/15 Mohamed Houri www.hourim.wordpress.com
12
ACS – bind sensitive : range predicate
SQL> select count(1) from t_acs where n2 <= :ln2;
SQL> select
sql_id
,child_number
,is_bind_sensitive
from
v$sql
where
sql_id = 'ct0yv82p15jdw';
SQL_ID CHILD_NUMBER IS_BIND_SENSITIVE
------------- ------------ -----------------
ct0yv82p15jdw 0 Y
range predicate
cursor is bind sensitive
13. 28/11/15 Mohamed Houri www.hourim.wordpress.com
13
ACS – bind sensitive : equality predicate with histogram
SQL> BEGIN
dbms_stats.gather_table_stats
(user,'t_acs'
,method_opt => 'for all columns size auto'
,cascade => true
,estimate_percent => dbms_stats.auto_sample_size);
END;/
SQL> SELECT
column_name,
histogram
FROM user_tab_col_statistics
WHERE table_name = 'T_ACS'
AND column_name = 'N2';
COLUMN_NAME HISTOGRAM
----------------- -----------
N2 FREQUENCY
with histogram
with histogram
14. 28/11/15 Mohamed Houri www.hourim.wordpress.com
14
ACS – bind sensitive : equality predicate with histogram
SQL> select count(1) from t_acs where n2 = :ln2;
SQL> select
sql_id
,child_number
,is_bind_sensitive
from
v$sql
where
sql_id = 'f2pmwazy1rnfd';
SQL_ID CHILD_NUMBER IS_BIND_SENSITIVE
------------- ------------ –-----------------
f2pmwazy1rnfd 0 Y
equality predicate
with histogram
cursor is bind sensitive
15. 28/11/15 Mohamed Houri www.hourim.wordpress.com
15
ACS – bind sensitive : partition key
SQL> create table t_acs_part(n1 number, n2 number)
partition by range (n2)
( partition p1 values less than (100)
,partition p2 values less than (1000)
,partition p3 values less than (10000)
,partition p4 values less than (100000)
,partition p5 values less than (1000000)
,partition p6 values less than (10000000));
SQL> –- insert data and gather stats without histogram
SQL> select column_name, histogram
FROM user_tab_col_statistics
where table_name = 'T_ACS_PART' AND column_name = 'N2';
COLUMN_NAM HISTOGRAM
---------- ---------
N2 NONE
16. 28/11/15 Mohamed Houri www.hourim.wordpress.com
16
ACS – bind sensitive : partition key
SQL> select count(1) from t_acs where n2 = :ln2;
SQL> select
sql_id
,child_number
,is_bind_sensitive
from
v$sql
where
sql_id = 'byztzuffb65n9';
SQL_ID CHILD_NUMBER IS_BIND_SENSITIVE
------------- ------------ –----------------
byztzuffb65n9 0 Y
partition key
cursor is bind sensitive
17. 28/11/15 Mohamed Houri www.hourim.wordpress.com
17
ACS – bind sensitive : summary
range predicate (with simple statistics)
SQL> select count(1) from t_acs where n2 <= :ln2;
equality predicate (with histogram)
SQL> select count(1) from t_acs where n2 = :ln2;
predicate with partition key (simple stats)
SQL> select count(1) from t_acs where n2 = :ln2;
18. 28/11/15 Mohamed Houri www.hourim.wordpress.com
18
18
PART II
ACS-simple example
A SIMPLE ACS EXAMPLE
19. 28/11/15 Mohamed Houri www.hourim.wordpress.com
19
ACS-simple example
SQL> exec :ln2 := 100
SQL> select count(1) from t_acs where n2 = :ln2;
SQL> select n2,count(1) from t_acs group by n2 order by 2;
N2 COUNT(1)
---------- ----------
1 1
100 100
1000 1000
10000 100000
1000000 1099049
index range scan
full table scan
20. 28/11/15 Mohamed Houri www.hourim.wordpress.com
20
ACS-simple example
SQL_ID f2pmwazy1rnfd, child number 0
-----------------------------------------------------
| Id | Operation | Name | Rows | Bytes |
-----------------------------------------------------
| 0 | SELECT STATEMENT | | | |
| 1 | SORT AGGREGATE | | 1 | 3 |
|* 2 | INDEX RANGE SCAN| T_ACS_I1 | 856 | 2568 |
-----------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - access("N2"=:LN2)
optimal plan for the first execution.
Plan has been hard parsed
21. 28/11/15 Mohamed Houri www.hourim.wordpress.com
21
ACS-simple example
SQL> exec :ln2 := 1000000
–- 1st
execution with bind variable value = 1000000
SQL> select count(1) from t_acs where n2 = :ln2;
SQL_ID f2pmwazy1rnfd, child number 0
-----------------------------------------------------
| Id | Operation | Name | Rows | Bytes |
-----------------------------------------------------
| 0 | SELECT STATEMENT | | | |
| 1 | SORT AGGREGATE | | 1 | 3 |
|* 2 | INDEX RANGE SCAN| T_ACS_I1 | 856 | 2568 |
-----------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - access("N2"=:LN2)
sharing plan is bad here
22. 28/11/15 Mohamed Houri www.hourim.wordpress.com
22
ACS-simple example
SQL> exec :ln2 := 1000000
–- 2nd
execution with bind variable value = 1000000
SQL> select count(1) from t_acs where n2 = :ln2;
SQL_ID f2pmwazy1rnfd, child number 1
-----------------------------------------------------
| Id | Operation | Name | Rows | Bytes |
-----------------------------------------------------
| 0 | SELECT STATEMENT | | | |
| 1 | SORT AGGREGATE | | 1 | 3 |
|* 2 | TABLE ACCESS FULL| T_ACS | 1104K| 3235K|
-----------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 – filter("N2"=:LN2) optimal plan at the second
execution
23. 28/11/15 Mohamed Houri www.hourim.wordpress.com
23
ACS-simple example
–- back to the first bind variable value 100
SQL> exec :ln2 := 100
SQL> select count(1) from t_acs where n2 = :ln2;
SQL_ID f2pmwazy1rnfd, child number 2
------------------------------------------------------
| Id | Operation | Name | Rows | Bytes |
------------------------------------------------------
| 0 | SELECT STATEMENT | | | |
| 1 | SORT AGGREGATE | | 1 | 3 |
|* 2 | INDEX RANGE SCAN| T_ACS_I1 | 1713 | 5139 |
------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 – access("N2"=:LN2) execution plan is now immediately
optimal
24. 28/11/15 Mohamed Houri www.hourim.wordpress.com
24
SQL> select
sql_id
,child_number
,is_bind_sensitive
,is_bind_aware
from
v$sql
where
sql_id = 'f2pmwazy1rnfd';
SQL_ID CHILD_NUMBER IS_BIND_SENS IS_BIND_AWARE
------------- ------------ –----------- –-------------
f2pmwazy1rnfd 0 Y N → index-RS
f2pmwazy1rnfd 1 Y Y → table-FS
f2pmwazy1rnfd 2 Y Y → index-RS
is that cursor is now bind aware
what happens?
ACS-simple example
25. 28/11/15 Mohamed Houri www.hourim.wordpress.com
25
ACS-simple example
We have gone wrong(index range scan plan shared) during the
first execution with :ln2 := 1000000
It is until the second execution with :ln2 := 1000000 that Oracle has
compiled a new optimal plan (full table scan)
We have to share the “wrong” plan during a certain number of
executions
This “certain number” of executions is strongly related to the number
of executions done at the initial bind variable value :ln2 := 100
This execution-count relationship will be explained later
(BUCKET_ID, COUNT)
26. 28/11/15 Mohamed Houri www.hourim.wordpress.com
26
26
PART III
ACS-bind aware secret sauce
When Oracle decides that it is time to compile
a new execution plan?
27. 28/11/15 Mohamed Houri www.hourim.wordpress.com
27
27
SQL> desc V$SQL_CS_STATISTICS
Name Null? Type
------------------------------- -------- --------------
1 ADDRESS RAW(8)
2 HASH_VALUE NUMBER
3 SQL_ID VARCHAR2(13)
4 CHILD_NUMBER NUMBER
5 BIND_SET_HASH_VALUE NUMBER
6 PEEKED VARCHAR2(1)
7 EXECUTIONS NUMBER
8 ROWS_PROCESSED NUMBER
9 BUFFER_GETS NUMBER
10 CPU_TIME NUMBER
11 CON_ID NUMBER
ACS-bind aware secret sauce
Starting from 12c this
view is obsolete
28. 28/11/15 Mohamed Houri www.hourim.wordpress.com
28
28
SQL> desc V$SQL_CS_HISTOGRAM
Name Null? Type
------------------------------- -------- -------------
1 ADDRESS RAW(8)
2 HASH_VALUE NUMBER
3 SQL_ID VARCHAR2(13)
4 CHILD_NUMBER NUMBER
5 BUCKET_ID NUMBER
6 COUNT NUMBER
7 CON_ID NUMBER
ACS-bind aware secret sauce
number of executions
done at this child_number
linked to the number of
rows processed by
this child_number
29. 28/11/15 Mohamed Houri www.hourim.wordpress.com
29
29
SQL> desc V$SQL_CS_SELECTIVITY
Name Null? Type
----------------------- -------- --------------
1 ADDRESS RAW(8)
2 HASH_VALUE NUMBER
3 SQL_ID VARCHAR2(13)
4 CHILD_NUMBER NUMBER
5 PREDICATE VARCHAR2(40)
6 RANGE_ID NUMBER
7 LOW VARCHAR2(10)
8 HIGH VARCHAR2(10)
9 CON_ID NUMBER
ACS-bind aware secret sauce
This view becomes useful
only when cursor is
bind aware
30. 28/11/15 Mohamed Houri www.hourim.wordpress.com
30
30
ACS-bind aware secret sauce
0 <= ROWS_PROCESSED< 1,000
increments COUNT
of BUCKET_ID n° 0
1,000 <= ROWS_PROCESSED<= 1,000,000
increments COUNT
of BUCKET_ID n° 1
ROWS_PROCESSED> 1,000,000
increments COUNT
of BUCKET_ID n° 2
Inflexion point
Inflexion point
31. 28/11/15 Mohamed Houri www.hourim.wordpress.com
31
SQL> exec :ln2 := 100 –- 1st
execution with this value
SQL> select count(1) from t_acs where n2 = :ln2;
COUNT(1)
----------
100
ACS-bind aware secret sauce
Nbr of rows processed <1000
SQL> select
child_number,bucket_id,count
from
v$sql_cs_histogram
where sql_id = 'f2pmwazy1rnfd' ;
CHILD_NUMBER BUCKET_ID COUNT
------------ ---------- ----------
0 0 1
0 1 0
0 2 0
count(bucket_id n°0)
incremented
32. 28/11/15 Mohamed Houri www.hourim.wordpress.com
32
SQL> exec :ln2 := 100 –- 2nd
execution with this value
SQL> select count(1) from t_acs where n2 = :ln2;
COUNT(1)
----------
100
ACS-bind aware secret sauce
SQL> select
child_number,bucket_id,count
from
v$sql_cs_histogram
where sql_id = 'f2pmwazy1rnfd' ;
CHILD_NUMBER BUCKET_ID COUNT
------------ ---------- ----------
0 0 2
0 1 0
0 2 0
count(bucket_id n°0)
incremented
Nbr of rows processed <1000
33. 28/11/15 Mohamed Houri www.hourim.wordpress.com
33
SQL> exec :ln2 := 100 –- 3rd
execution with this value
SQL> select count(1) from t_acs where n2 = :ln2;
COUNT(1)
----------
100
ACS-bind aware secret sauce
SQL> select
child_number,bucket_id,count
from
v$sql_cs_histogram
where sql_id = 'f2pmwazy1rnfd' ;
CHILD_NUMBER BUCKET_ID COUNT
------------ ---------- ----------
0 0 3
0 1 0
0 2 0
count(bucket_id n°0)
incremented
Nbr of rows processed <1000
34. 28/11/15 Mohamed Houri www.hourim.wordpress.com
34
SQL> exec :ln2 := 1000 –- 1st
execution with this value
SQL> select count(1) from t_acs where n2 = :ln2;
COUNT(1)
-------
1000
ACS-bind aware secret sauce
SQL> select
child_number,bucket_id,count
from
v$sql_cs_histogram
where sql_id = 'f2pmwazy1rnfd' ;
CHILD_NUMBER BUCKET_ID COUNT
------------ ---------- ----------
0 0 3
0 1 1
0 2 0
count(bucket_id n°1)
incremented
1000<= Nbr of rows processed <= 1e6
still sharing same plan
35. 28/11/15 Mohamed Houri www.hourim.wordpress.com
35
SQL> exec :ln2 := 1000 –-2nd
execution with this value
SQL> select count(1) from t_acs where n2 = :ln2;
COUNT(1)
-------
1000
ACS-bind aware secret sauce
SQL> select
child_number,bucket_id,count
from
v$sql_cs_histogram
where sql_id = 'f2pmwazy1rnfd' ;
CHILD_NUMBER BUCKET_ID COUNT
------------ ---------- ----------
0 0 3
0 1 2
0 2 0
count(bucket_id n°1)
incremented
1000<= Nbr of rows processed <= 1e6
still sharing same plan
36. 28/11/15 Mohamed Houri www.hourim.wordpress.com
36
SQL> exec :ln2 := 1000 –-3rd
execution with this value
SQL> select count(1) from t_acs where n2 = :ln2;
COUNT(1)
-------
1000
ACS-bind aware secret sauce
SQL> select
child_number,bucket_id,count
from
v$sql_cs_histogram
where sql_id = 'f2pmwazy1rnfd' ;
CHILD_NUMBER BUCKET_ID COUNT
------------ ---------- ----------
0 0 3
0 1 3
0 2 0
count(bucket_id n°1)
incremented
1000<= Nbr of rows processed <= 1e6
still sharing same plan
37. 28/11/15 Mohamed Houri www.hourim.wordpress.com
37
SQL> exec :ln2 := 1000 –-4th
execution with this value
SQL> select count(1) from t_acs where n2 = :ln2;
ACS-bind aware secret sauce
SQL> select
child_number,bucket_id,count
from
v$sql_cs_histogram
where sql_id = 'f2pmwazy1rnfd' ;
CHILD_NUMBER BUCKET_ID COUNT
------------ ---------- ----------
1 0 0
1 1 1
1 2 0
0 0 3
0 1 3
0 2 0
count(bucket_id n°1)
incremented
new compiled plan
38. 28/11/15 Mohamed Houri www.hourim.wordpress.com
38
SQL> select
sql_id
,child_number
,is_bind_sensitive
,is_bind_aware
from
v$sql
where
sql_id = 'f2pmwazy1rnfd';
SQL_ID CHILD_NUMBER IS_BIND_SENS IS_BIND_AWARE
------------- ------------ –----------- –-------------
f2pmwazy1rnfd 0 Y N
f2pmwazy1rnfd 1 Y Y
cursor n° 1 is now bind aware
ACS-bind aware secret sauce
39. 28/11/15 Mohamed Houri www.hourim.wordpress.com
39
39
ACS-bind aware secret sauce – rule n° 1 : adjacent buckets
COUNT(BUCKET_ID n° 1) = COUNT(BUCKET_ID n° 0)
OR
COUNT(BUCKET_ID n° 2) = COUNT(BUCKET_ID n° 1)
The next execution at BUCKET_ID n°1 (or n°2) will
mark the cursor bind aware
and a new execution plan will be compiled
41. 28/11/15 Mohamed Houri www.hourim.wordpress.com
41
SQL> exec :ln2 := 1000000 –- bucket_id n°2
SQL> select count(1) from t_acs where n2 = :ln2;
COUNT(1)
----------
1099049
ACS-bind aware secret sauce : distant bucket_id
SQL> select
child_number,bucket_id,count
from
v$sql_cs_histogram
where sql_id = 'f2pmwazy1rnfd' ;
CHILD_NUMBER BUCKET_ID COUNT
------------ ---------- ----------
0 0 10
0 1 0
0 2 1
count(bucket_id n°2)
Incremented 1 time
still sharing same plan
Nbr of rows > 1e6
42. 28/11/15 Mohamed Houri www.hourim.wordpress.com
42
Question : How many executions at bucket_id n°2 we need to have
before Oracle compile a new optimal plan?
ACS-bind aware secret sauce : distant bucket_id
–- run this 3 times
SQL> select count(1) from t_acs where n2 = :ln2;
SQL> select
child_number,bucket_id,count
from
v$sql_cs_histogram
where sql_id = 'f2pmwazy1rnfd' ;
CHILD_NUMBER BUCKET_ID COUNT
------------ ---------- ----------
0 0 10
0 1 0
0 2 4
count(bucket_id n°2)
incremented 3 times
Answer : 4 executions
still sharing the
same plan
43. 28/11/15 Mohamed Houri www.hourim.wordpress.com
43
SQL> exec :ln2 := 1000000 –-5th
execution at this value
SQL> select count(1) from t_acs where n2 = :ln2;
SQL> select
child_number,bucket_id,count
from
v$sql_cs_histogram
where sql_id = 'f2pmwazy1rnfd' ;
CHILD_NUMBER BUCKET_ID COUNT
------------ ---------- ----------
1 0 0
1 1 0
1 2 1
0 0 10
0 1 0
0 2 4
10 exec at bucket_id n°0
new compiled plan
ACS-bind aware secret sauce : distant bucket_id
4 exec at bucket_id n°2
44. 28/11/15 Mohamed Houri www.hourim.wordpress.com
44
44
4 = ceil (10/3)
The next execution at BUCKET_ID n°2 will
mark the cursor bind aware
and a new execution plan will be compiled
ACS-bind aware secret sauce : distant bucket_id
Applies only with distant bucket_id (0 and 2)
COUNT(BUCKET_ID n° 2) = ceil (COUNT(BUCKET_ID n° 0)/3)
45. 28/11/15 Mohamed Houri www.hourim.wordpress.com
45
ACS-bind aware secret sauce : all buckets involved
SQL> select
child_number,bucket_id,count
from
v$sql_cs_histogram
where sql_id = 'f2pmwazy1rnfd' ;
CHILD_NUMBER BUCKET_ID COUNT
------------ ---------- ----------
0 0 10
0 1 3
0 2 1
Question : How many executions at bucket_id n°2 we need to have
before Oracle compiles a new optimal plan?
10 exec at bucket_id n°0
3 exec at bucket_id n°1
1 exec at bucket_id n°2
46. 28/11/15 Mohamed Houri www.hourim.wordpress.com
46
ACS-bind aware secret sauce : all buckets involved
------------------------------------------------------------------------------
-- File name: fv_will_cs_be_bind_aware
-- Author : Mohamed Houri ([email protected])
-- Date : 29/08/2015
-- Purpose : When supplied with 3 parameters
-- pin_cnt_bucket_0 : count of bucket_id n°0
-- pin_cnt_bucket_1 : count of bucket_id n°1
-- pin_cnt_bucket_2 : count of bucket_id n°2
-- this function will return a status:
-- 'Y' if the next execution at any bucket_id will mark the cursor bind aware
-- 'N' if the next execution any bucket_id will NOT mark the cursor bind aware
--------------------------------------------------------------------------------
create or replace function fv_will_cs_be_bind_aware
(pin_cnt_bucket_0 in number,pin_cnt_bucket_1 in number,pin_cnt_bucket_2 in number)
return varchar2 is
lv_will_be_bind_aware varchar2(1) := 'N';
ln_least_0_2 number := least(pin_cnt_bucket_0,pin_cnt_bucket_2);
ln_great_0_2 number := greatest(pin_cnt_bucket_0,pin_cnt_bucket_2);
begin
if pin_cnt_bucket_0 + pin_cnt_bucket_2 > = pin_cnt_bucket_1
and ln_least_0_2 >= ceil ((ln_great_0_2-pin_cnt_bucket_1)/3)then
return 'Y';
else
return 'N';
end if;
end fv_will_cs_be_bind_aware;
47. 28/11/15 Mohamed Houri www.hourim.wordpress.com
47
ACS-bind aware secret sauce : all buckets involved
SQL> select
child_number,bucket_id,count
from
v$sql_cs_histogram
where sql_id = 'f2pmwazy1rnfd' ;
CHILD_NUMBER BUCKET_ID COUNT
------------ ---------- ----------
0 0 10
0 1 3
0 2 1
SQL> select fv_will_cs_be_bind_aware(10,3,1) acs from dual;
ACS
----
N
next execution will share the same plan
48. 28/11/15 Mohamed Houri www.hourim.wordpress.com
48
SQL> exec :ln2 := 1000000 –- 2nd
execution at this value
SQL> select count(1) from t_acs where n2 = :ln2;
SQL> select
child_number,bucket_id,count
from
v$sql_cs_histogram
where sql_id = 'f2pmwazy1rnfd' ;
CHILD_NUMBER BUCKET_ID COUNT
------------ ---------- ----------
0 0 10
0 1 3
0 2 2
SQL> select fv_will_cs_be_bind_aware(10,3,2) acs from dual;
ACS
----
N next execution will share the same plan
ACS-bind aware secret sauce : all buckets involved
49. 28/11/15 Mohamed Houri www.hourim.wordpress.com
49
SQL> exec :ln2 := 1000000 –- 3rd
execution at this value
SQL> select count(1) from t_acs where n2 = :ln2;
SQL> select
child_number,bucket_id,count
from
v$sql_cs_histogram
where sql_id = 'f2pmwazy1rnfd' ;
CHILD_NUMBER BUCKET_ID COUNT
------------ ---------- ----------
0 0 10
0 1 3
0 2 3
SQL> select fv_will_cs_be_bind_aware(10,3,3) acs from dual;
ACS
----
Y next execution will compile a new plan
ACS-bind aware secret sauce : all buckets involved
50. 28/11/15 Mohamed Houri www.hourim.wordpress.com
50
SQL> exec :ln2 := 1000000 –- 4th
execution at this value
SQL> select count(1) from t_acs where n2 = :ln2;
SQL> select
child_number,bucket_id,count
from
v$sql_cs_histogram
where sql_id = 'f2pmwazy1rnfd' ;
CHILD_NUMBER BUCKET_ID COUNT
------------ ---------- ----------
1 0 0
1 1 0
1 2 1
0 0 10
0 1 3
0 2 3
new execution plan compiled
ACS-bind aware secret sauce : all buckets involved
51. 28/11/15 Mohamed Houri www.hourim.wordpress.com
51
51
The next exection at any BUCKET will
mark the cursor bind aware
and a new execution plan will be
compiled
SQL> select
fv_will_cs_be_bind_aware
(pin_cnt_bucket_0
,pin_cnt_bucket_1
,pin_cnt_bucket_2 )
from dual;
Existing plan will be
shared
N Y
Not extensively tested!!!
ACS-bind aware secret sauce : all buckets involved
52. 28/11/15 Mohamed Houri www.hourim.wordpress.com
52
52
ACS-bind aware secret sauce : summary
COUNT(BUCKET_ID 1) =
COUNT(BUCKET_ID 0)
ADJACENT BUCKET_ID
(0-1 or 1-2)
next execution will compile
a new execution plan
COUNT(BUCKET_ID 2) =
CEIL(COUNT(BUCKET_ID 0)
/3)
next execution will compile
a new execution plan
DISTANT BUCKET_ID
(0-2)
select
fv_will_cs_be_bind_aware
(0,1,2) from dual; → Y
next execution will compile
a new execution plan
ALL BUCKET_ID
involved
53. 28/11/15 Mohamed Houri www.hourim.wordpress.com
53
53
PART IV
Extended Cursor Sharing
Extended Cursor Sharing- ECS
54. 28/11/15 Mohamed Houri www.hourim.wordpress.com
54
54
Extended Cursor Sharing
Adaptive Cursor Sharing
Extended Cursor Sharing
is responsible for marking bind aware
a bind sensitive cursor provided one of
the 3 rules is satisfied
is responsible for checking if an execution
plan of a bind aware cursor has to be
shared or a new plan has to be compiled
according to the bind variable selectivity
it peeks at each execution
55. 28/11/15 Mohamed Houri www.hourim.wordpress.com
55
SQL> select
sql_id
,child_number
,is_bind_sensitive
,is_bind_aware
from
v$sql
where
sql_id = 'f2pmwazy1rnfd';
SQL_ID CHILD_NUMBER IS_BIND_SENS IS_BIND_AWARE
------------- ------------ –----------- –-------------
f2pmwazy1rnfd 0 Y N
f2pmwazy1rnfd 1 Y Y
once a cursor is bind aware a row exists in v$sql_cs_selectivity
Extended Cursor Sharing
56. 28/11/15 Mohamed Houri www.hourim.wordpress.com
56
SQL> select
child_number
,predicate
,low
,high
From v$sql_cs_selectivity
where sql_id = 'f2pmwazy1rnfd';
CHILD_NUMBER PREDICATE LOW HIGH
------------ ------------- ---------- ----------
2 =LN2 0.827448 1.011325
1 =LN2 0.000807 0.000986
Extended Cursor Sharing
for each execution bind variable selectivity is
checked: if it exists in one of the LOW-HIGH
ranges then share plan. If not then compile a new
plan and insert/update a new LOW-HIGH range
this is ECS
57. 28/11/15 Mohamed Houri www.hourim.wordpress.com
57
57
PART V
Extended Cursor Sharing causing a performance issue
When ACS (in fact ECS) becomes a serious
performance threat
58. 28/11/15 Mohamed Houri www.hourim.wordpress.com
58
SQL> select
sql_id
,count(1)
from
v$sql
where executions < 2
group by sql_id
having count(1) > 10
order by 2 desc;
SQL_ID COUNT(1)
------------- ----------
7zwq7z1nj7vga 44217
Extended Cursor Sharing causing a performance issue
Why this high nbr
of versions?
59. 28/11/15 Mohamed Houri www.hourim.wordpress.com
59
SQL> @nonshared 7zwq7z1nj7vga
Show why existing SQL child cursors were not reused(V$SQL_SHARED_CURSOR)
-----------------
SQL_ID : 7zwq7z1nj7vga
ADDRESS : 000000406DBB30F8
CHILD_ADDRESS : 00000042CE36F7E8
CHILD_NUMBER : 99
BIND_EQUIV_FAILURE : Y
REASON :<ChildNode><ChildNumber>0</ChildNumber><ID>40</ID>
<reason>Bindmismatch(33)</reason><size>2x4</size>
<init_ranges_in_first_pass>0</init_ranges_in_first_pass>
<selectivity>1097868685</selectivity>
</ChildNode>
Extended Cursor Sharing causing a performance issue
100 exec plans (0-99)
due to bind_equivalent_failure
60. 28/11/15 Mohamed Houri www.hourim.wordpress.com
60
SQL> select count(1)
from v$sql_shared_cursor
Where sql_id = '7zwq7z1nj7vga';
COUNT(1)
----------
45125
SQL> select count(1)
from v$sql_shared_cursor
Where sql_id = '7zwq7z1nj7vga'
and BIND_EQUIV_FAILURE = 'Y';
COUNT(1)
----------
45121
99% of non shared cursors are due to
BIND_EQUIV_FAILURE
Extended Cursor Sharing causing a performance issue
61. 28/11/15 Mohamed Houri www.hourim.wordpress.com
61
BIND_EQUIV_FAILURE : bind value's selectivity does
not match that used to optimize the existing child
cursor
SQL> select
count(1)
from
v$sql_cs_selectivity
where
sql_id = '7zwq7z1nj7vga';
COUNT(1)
----------
16,847,320 !!!
for each execution ECS
will check this view!!!
Extended Cursor Sharing causing a performance issue
CHILD_NUMBER PREDICATE LOW HIGH
------------ ------------- ---------- ----------
2 =LN2 0.827448 1.011325
62. 28/11/15 Mohamed Houri www.hourim.wordpress.com
62
Extended Cursor Sharing causing a performance issue
Run a query using a bind aware cursor
Oracle (ECS layer code) will do behind the scene:
1. peeks at the bind variable value
2. runs a query against v$sql_cs_selectivity(16M of rows)
3. if low < selectivity < high then share existing plan
4. if selectity not found in low-high range then hard parse a new plan
If another user executes the same query:
1. Oracle will try to do the above 1-4 steps
2. if Oracle is still busy with above 1-4 steps then we start experiencing:
a) cursor: pin S wait on X
b) library cache lock
63. 28/11/15 Mohamed Houri www.hourim.wordpress.com
63
63
PART V
Adaptive-Extended Cursor Sharing
FINAL ACS-ECS DIAGRAM
https://hourim.wordpress.com/2015/08/12/adaptive-cursor-sharing-triggering-mechanism/
64. 28/11/15 Mohamed Houri www.hourim.wordpress.com
64
64
Adaptive Cursor Sharing
•Conclusion
• Literal variables are good for query performance
• very bad for resource and memory
• and they produce a non scalable application
• Bind variables are not always good for query performance
• very good for resource and memory
• and they produce a scalable application
• Adaptive cursor sharing allows query good performance
• even when using bind variable
• but be aware of the extra parsing work it might introduce