SlideShare une entreprise Scribd logo
1  sur  6
Oracle Hard and Soft Parsing

         Ishaan Guliani
•SQl code is
Loading into    loaded into
shared pool     RAM for
                parsing




                                •Checks for
               Syntax Parse      syntax errors
                                                                       Parsing of SQL
                                                   •Checks for
                                                    table/columns
                                                                          query in
                              Semantic Parse
                                                                           Oracle
                                                    names and
                                                    access




                                                     Query           •Transfroms
                                                                      complex SQL
                                                 Transformation       to simpler




                                                                                    •Creates and
                                                                    Optimization     execution plan




                                                                                                      •This Builds
                                                                                      Create           executable file
                                                                                    executable         with native file
                                                                                                       calls
Concept
• Look at the first step, a soft parse does not require a
  shared pool reload and associated RAM memory
  allocation, while a hard parse requires all this.
• Excessive Hard Parsing can occur when
   – Shared pool size is too small
   – (or) Query has non-reusable SQL statements without host
     variable
• This is a common scenario in many OLTP systems,
  where lot of small queries are being hit to the DB.
• In order to do soft parsing rather then hard , bind
  variables must be used in our SQL statments
Hard Parsed SQL
• declare
  type t_cur is ref cursor;
  cur t_cur;
  begin
  for j in 1..10000
  loop
  open cur for
  'SELECT b FROM xxx WHERE a = ' || to_char(j);
  close cur;
  - do some processing with "b"
  end loop;
  end;
  /
• Parse time: 5.89s
  Execute time: 2.62s
  TOTAL elapsed time: 8.51s
Soft Parsed SQL
• declare
  type t_cur is ref cursor;
  cur t_cur;
  begin
  for j in 1..10000
  loop
  open cur for
  'SELECT b FROM xxx WHERE a = :a' using j;
  close cur;
  - do some processing with "b"
  end loop;
  end;
  /
• Parse time: 0.01s
  Execute time: 2.58s
  TOTAL elapsed time: 2.59s (30% of the time!)
Thanks

Contenu connexe

Tendances

[Altibase] 10 replication part3 (system design)
[Altibase] 10 replication part3 (system design)[Altibase] 10 replication part3 (system design)
[Altibase] 10 replication part3 (system design)
altistory
 
SQL Explore 2012: P&T Part 2
SQL Explore 2012: P&T Part 2SQL Explore 2012: P&T Part 2
SQL Explore 2012: P&T Part 2
sqlserver.co.il
 
Best Practices of HA and Replication of PostgreSQL in Virtualized Environments
Best Practices of HA and Replication of PostgreSQL in Virtualized EnvironmentsBest Practices of HA and Replication of PostgreSQL in Virtualized Environments
Best Practices of HA and Replication of PostgreSQL in Virtualized Environments
Jignesh Shah
 

Tendances (20)

Blue Medora Oracle Enterprise Manager (EM12c) Plug-in for PostgreSQL
Blue Medora Oracle Enterprise Manager (EM12c) Plug-in for PostgreSQLBlue Medora Oracle Enterprise Manager (EM12c) Plug-in for PostgreSQL
Blue Medora Oracle Enterprise Manager (EM12c) Plug-in for PostgreSQL
 
z/OS Workload Management Update for z/OS V1.11 and V1.12
z/OS Workload Management Update for z/OS V1.11 and V1.12z/OS Workload Management Update for z/OS V1.11 and V1.12
z/OS Workload Management Update for z/OS V1.11 and V1.12
 
PostgreSQL and Benchmarks
PostgreSQL and BenchmarksPostgreSQL and Benchmarks
PostgreSQL and Benchmarks
 
Layers in Deep Learning & Caffe layers (model architecture )
Layers in Deep Learning&Caffe layers (model architecture )Layers in Deep Learning&Caffe layers (model architecture )
Layers in Deep Learning & Caffe layers (model architecture )
 
operating system
operating systemoperating system
operating system
 
Xml to-object-transformer
Xml to-object-transformerXml to-object-transformer
Xml to-object-transformer
 
Mule Schema Validation Filter
Mule Schema Validation FilterMule Schema Validation Filter
Mule Schema Validation Filter
 
Weblogic performance tuning2
Weblogic performance tuning2Weblogic performance tuning2
Weblogic performance tuning2
 
MySQL Performance Tuning - GNUnify 2010
MySQL Performance Tuning - GNUnify 2010MySQL Performance Tuning - GNUnify 2010
MySQL Performance Tuning - GNUnify 2010
 
Building large scale, job processing systems with Scala Akka Actor framework
Building large scale, job processing systems with Scala Akka Actor frameworkBuilding large scale, job processing systems with Scala Akka Actor framework
Building large scale, job processing systems with Scala Akka Actor framework
 
[Altibase] 10 replication part3 (system design)
[Altibase] 10 replication part3 (system design)[Altibase] 10 replication part3 (system design)
[Altibase] 10 replication part3 (system design)
 
Understanding DB2 Optimizer
Understanding DB2 OptimizerUnderstanding DB2 Optimizer
Understanding DB2 Optimizer
 
[Altibase] 12 replication part5 (optimization and monitoring)
[Altibase] 12 replication part5 (optimization and monitoring)[Altibase] 12 replication part5 (optimization and monitoring)
[Altibase] 12 replication part5 (optimization and monitoring)
 
Managing and Configuring Databases
Managing and Configuring DatabasesManaging and Configuring Databases
Managing and Configuring Databases
 
Understanding and controlling transaction logs
Understanding and controlling transaction logsUnderstanding and controlling transaction logs
Understanding and controlling transaction logs
 
SQL Explore 2012: P&T Part 2
SQL Explore 2012: P&T Part 2SQL Explore 2012: P&T Part 2
SQL Explore 2012: P&T Part 2
 
Best Practices of HA and Replication of PostgreSQL in Virtualized Environments
Best Practices of HA and Replication of PostgreSQL in Virtualized EnvironmentsBest Practices of HA and Replication of PostgreSQL in Virtualized Environments
Best Practices of HA and Replication of PostgreSQL in Virtualized Environments
 
MySQL Tuning
MySQL TuningMySQL Tuning
MySQL Tuning
 
High Availability Options for DB2 Data Centre
High Availability Options for DB2 Data CentreHigh Availability Options for DB2 Data Centre
High Availability Options for DB2 Data Centre
 
Executing oracle ebs stored
Executing oracle ebs storedExecuting oracle ebs stored
Executing oracle ebs stored
 

En vedette

MarketLine Country Statistics Database
MarketLine Country Statistics DatabaseMarketLine Country Statistics Database
MarketLine Country Statistics Database
MarketLine
 

En vedette (20)

Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 1
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 1Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 1
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 1
 
Anil nair rac_internals_sangam_2016
Anil nair rac_internals_sangam_2016Anil nair rac_internals_sangam_2016
Anil nair rac_internals_sangam_2016
 
Lesson11 Create Query
Lesson11 Create QueryLesson11 Create Query
Lesson11 Create Query
 
Trabalho fitos digitais
Trabalho fitos digitaisTrabalho fitos digitais
Trabalho fitos digitais
 
Lesson4 Protect and maintain databases
Lesson4 Protect and maintain databases Lesson4 Protect and maintain databases
Lesson4 Protect and maintain databases
 
التحدى 6 الإستعلام بطريقة المعالج
التحدى 6 الإستعلام بطريقة المعالجالتحدى 6 الإستعلام بطريقة المعالج
التحدى 6 الإستعلام بطريقة المعالج
 
Lesson8 Manage Records
Lesson8 Manage RecordsLesson8 Manage Records
Lesson8 Manage Records
 
MarketLine Country Statistics Database
MarketLine Country Statistics DatabaseMarketLine Country Statistics Database
MarketLine Country Statistics Database
 
Chapter 11new
Chapter 11newChapter 11new
Chapter 11new
 
Lesson5 Print and export databases
Lesson5 Print and export databases Lesson5 Print and export databases
Lesson5 Print and export databases
 
Performance Tuning Azure SQL Database
Performance Tuning Azure SQL DatabasePerformance Tuning Azure SQL Database
Performance Tuning Azure SQL Database
 
الوحدة التاسعة - قاعدة البيانات وادارتها
الوحدة التاسعة - قاعدة البيانات وادارتهاالوحدة التاسعة - قاعدة البيانات وادارتها
الوحدة التاسعة - قاعدة البيانات وادارتها
 
Performance tuning in sql server
Performance tuning in sql serverPerformance tuning in sql server
Performance tuning in sql server
 
Oracle 11g PL/SQL proqramlamlaşdırma yenilikləri
Oracle 11g PL/SQL proqramlamlaşdırma yenilikləri Oracle 11g PL/SQL proqramlamlaşdırma yenilikləri
Oracle 11g PL/SQL proqramlamlaşdırma yenilikləri
 
أساسيات التأمين
أساسيات التأمينأساسيات التأمين
أساسيات التأمين
 
Top frinds-انشاء-استعلام-بطريقه-المعالج-6-copy
Top frinds-انشاء-استعلام-بطريقه-المعالج-6-copyTop frinds-انشاء-استعلام-بطريقه-المعالج-6-copy
Top frinds-انشاء-استعلام-بطريقه-المعالج-6-copy
 
SQL Server Tuning to Improve Database Performance
SQL Server Tuning to Improve Database PerformanceSQL Server Tuning to Improve Database Performance
SQL Server Tuning to Improve Database Performance
 
Database system concepts and architecture
Database system concepts and architectureDatabase system concepts and architecture
Database system concepts and architecture
 
Webinar: Performance Tuning + Optimization
Webinar: Performance Tuning + OptimizationWebinar: Performance Tuning + Optimization
Webinar: Performance Tuning + Optimization
 
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
 

Similaire à Oracle hard and soft parsing

Infinispan, Data Grids, NoSQL, Cloud Storage and JSR 347
Infinispan, Data Grids, NoSQL, Cloud Storage and JSR 347Infinispan, Data Grids, NoSQL, Cloud Storage and JSR 347
Infinispan, Data Grids, NoSQL, Cloud Storage and JSR 347
Manik Surtani
 
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex
James Chen
 
OOW09 Ebs Tuning Final
OOW09 Ebs Tuning FinalOOW09 Ebs Tuning Final
OOW09 Ebs Tuning Final
jucaab
 
Handling Massive Writes
Handling Massive WritesHandling Massive Writes
Handling Massive Writes
Liran Zelkha
 

Similaire à Oracle hard and soft parsing (20)

Divide and conquer in the cloud
Divide and conquer in the cloudDivide and conquer in the cloud
Divide and conquer in the cloud
 
Seda与Java并行编程点滴
Seda与Java并行编程点滴Seda与Java并行编程点滴
Seda与Java并行编程点滴
 
Infinispan, Data Grids, NoSQL, Cloud Storage and JSR 347
Infinispan, Data Grids, NoSQL, Cloud Storage and JSR 347Infinispan, Data Grids, NoSQL, Cloud Storage and JSR 347
Infinispan, Data Grids, NoSQL, Cloud Storage and JSR 347
 
Oracle Database Performance Tuning Concept
Oracle Database Performance Tuning ConceptOracle Database Performance Tuning Concept
Oracle Database Performance Tuning Concept
 
Composable Futures with Akka 2.0
Composable Futures with Akka 2.0Composable Futures with Akka 2.0
Composable Futures with Akka 2.0
 
Ora 4 the_sqldba
Ora 4 the_sqldbaOra 4 the_sqldba
Ora 4 the_sqldba
 
XCPU3: Workload Distribution and Aggregation
XCPU3: Workload Distribution and AggregationXCPU3: Workload Distribution and Aggregation
XCPU3: Workload Distribution and Aggregation
 
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex
[Hic2011] using hadoop lucene-solr-for-large-scale-search by systex
 
Philly DB MapR Overview
Philly DB MapR OverviewPhilly DB MapR Overview
Philly DB MapR Overview
 
Functional? Reactive? Why?
Functional? Reactive? Why?Functional? Reactive? Why?
Functional? Reactive? Why?
 
Bridging the Developer and the Datacenter
Bridging the Developer and the DatacenterBridging the Developer and the Datacenter
Bridging the Developer and the Datacenter
 
Arc 300-3 ade miller-en
Arc 300-3 ade miller-enArc 300-3 ade miller-en
Arc 300-3 ade miller-en
 
OOW09 Ebs Tuning Final
OOW09 Ebs Tuning FinalOOW09 Ebs Tuning Final
OOW09 Ebs Tuning Final
 
A Closer Look at Apache Kudu
A Closer Look at Apache KuduA Closer Look at Apache Kudu
A Closer Look at Apache Kudu
 
Dal deck
Dal deckDal deck
Dal deck
 
Jay Kreps on Project Voldemort Scaling Simple Storage At LinkedIn
Jay Kreps on Project Voldemort Scaling Simple Storage At LinkedInJay Kreps on Project Voldemort Scaling Simple Storage At LinkedIn
Jay Kreps on Project Voldemort Scaling Simple Storage At LinkedIn
 
Handling Massive Writes
Handling Massive WritesHandling Massive Writes
Handling Massive Writes
 
Streaming Replication (Keynote @ PostgreSQL Conference 2009 Japan)
Streaming Replication (Keynote @ PostgreSQL Conference 2009 Japan)Streaming Replication (Keynote @ PostgreSQL Conference 2009 Japan)
Streaming Replication (Keynote @ PostgreSQL Conference 2009 Japan)
 
Google Compute and MapR
Google Compute and MapRGoogle Compute and MapR
Google Compute and MapR
 
Stardog talk-dc-march-17
Stardog talk-dc-march-17Stardog talk-dc-march-17
Stardog talk-dc-march-17
 

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 

Oracle hard and soft parsing

  • 1. Oracle Hard and Soft Parsing Ishaan Guliani
  • 2. •SQl code is Loading into loaded into shared pool RAM for parsing •Checks for Syntax Parse syntax errors Parsing of SQL •Checks for table/columns query in Semantic Parse Oracle names and access Query •Transfroms complex SQL Transformation to simpler •Creates and Optimization execution plan •This Builds Create executable file executable with native file calls
  • 3. Concept • Look at the first step, a soft parse does not require a shared pool reload and associated RAM memory allocation, while a hard parse requires all this. • Excessive Hard Parsing can occur when – Shared pool size is too small – (or) Query has non-reusable SQL statements without host variable • This is a common scenario in many OLTP systems, where lot of small queries are being hit to the DB. • In order to do soft parsing rather then hard , bind variables must be used in our SQL statments
  • 4. Hard Parsed SQL • declare type t_cur is ref cursor; cur t_cur; begin for j in 1..10000 loop open cur for 'SELECT b FROM xxx WHERE a = ' || to_char(j); close cur; - do some processing with "b" end loop; end; / • Parse time: 5.89s Execute time: 2.62s TOTAL elapsed time: 8.51s
  • 5. Soft Parsed SQL • declare type t_cur is ref cursor; cur t_cur; begin for j in 1..10000 loop open cur for 'SELECT b FROM xxx WHERE a = :a' using j; close cur; - do some processing with "b" end loop; end; / • Parse time: 0.01s Execute time: 2.58s TOTAL elapsed time: 2.59s (30% of the time!)