Home
Search results “Oracle query execution”
How Oracle SQL Query work
 
09:22
This video will give to understanding of SQL Parsing, Syntatic check , semantic check, spool file check, Sql Optimization, row source generation and sql execution.
Views: 17879 amit wadbude
Oracle tutorial : Using execution plan to optimize query in oracle
 
12:54
Oracle tutorial: Explain plan for query optimization in Oracle PLSQL oracle tutorial for beginners using execution plan to optimize query sql query analyzer sql query cost analysis https://techquerypond.wordpress.com This oracle tutorial show you how to use EXPLAIN PLAN in oracle. This video covers how to check cost of the query from DBMS_XPLAN.DISPLAY . You can find the cost of the query using the Using EXPLAIN PLAN FOR and based on the result you can optimize the query for faster performance. Subscribe on youtube: https://www.youtube.com/channel/UCpiyAesWNYOXSz5GPq8lbkA For more tutorial please visit #techquerypond https://twitter.com/techquerypond
Views: 8981 Tech Query Pond
SELECT statement Processing in an Oracle Database - DBArch  Video 7
 
06:22
You will learn from this video how a SELECT statement is processed in an Oracle Database. You will learn about the a Parse, Execute and Fetch phases in a select statement. Our Upcoming Online Course Schedule is available in the url below https://docs.google.com/spreadsheets/d/1qKpKf32Zn_SSvbeDblv2UCjvtHIS1ad2_VXHh2m08yY/edit#gid=0 Reach us at [email protected]
Views: 20562 Ramkumar Swaminathan
Oracle Performance Tuning - Read and interpret Explain Plan
 
17:43
Connect with me or follow me at https://www.linkedin.com/in/durga0gadiraju https://www.facebook.com/itversity https://github.com/dgadiraju https://www.youtube.com/c/TechnologyMentor https://twitter.com/itversity
Views: 36596 itversity
Query Tuning 101: How to Compare Execution Plans
 
04:12
When you're tuning SQL query there's two important questions to keep in mind: * Have my changes made any difference? * If they have, is performance better or worse? In this video we'll look at how you can use SQL Developer to compare execution plans. This will enable you to differences between them and determine which plan performs better. ============================ The Magic of SQL with Chris Saxon Copyright © 2015 Oracle and/or its affiliates. Oracle is a registered trademark of Oracle and/or its affiliates. All rights reserved. Other names may be registered trademarks of their respective owners. Oracle disclaims any warranties or representations as to the accuracy or completeness of this recording, demonstration, and/or written materials (the “Materials”). The Materials are provided “as is” without any warranty of any kind, either express or implied, including without limitation warranties or merchantability, fitness for a particular purpose, and non-infringement.
Views: 14182 The Magic of SQL
Query Analysis and Optimizing in Oracle
 
37:53
Database Management Systems 11. Query Analysis and Optimizing in Oracle ADUni
Views: 82802 Chao Xu
Oracle SQL SELECT Query Execution Process
 
04:09
Query Execution Process
Views: 1590 PNR Tech
Oracle Performance Tuning - Monitoring using Oracle Enterprise Manager
 
12:41
Connect with me or follow me at https://www.linkedin.com/in/durga0gadiraju https://www.facebook.com/itversity https://github.com/dgadiraju https://www.youtube.com/c/TechnologyMentor https://twitter.com/itversity
Views: 28185 itversity
Query Tuning 101 Why Use Autotrace
 
01:38
When you're optimizing SQL queries you need to understand what they're actually doing. Explain plan is a commonly used tool with a major flaw - the reported plan and actual plan can be different! This video demonstrates this with a simple query, showing how autotrace reports the correct execution plan for the SQL statement. ============================ The Magic of SQL with Chris Saxon Copyright © 2015 Oracle and/or its affiliates. Oracle is a registered trademark of Oracle and/or its affiliates. All rights reserved. Other names may be registered trademarks of their respective owners. Oracle disclaims any warranties or representations as to the accuracy or completeness of this recording, demonstration, and/or written materials (the “Materials”). The Materials are provided “as is” without any warranty of any kind, either express or implied, including without limitation warranties or merchantability, fitness for a particular purpose, and non-infringement.
Views: 2231 The Magic of SQL
SQL Tuning: Lấy Execution plan từ câu Query hoặc từ SQL_ID
 
08:21
In ra execution plan: - Từ câu query. - Sử dung câu lệnh: EXPLAIN PLAN FOR - SET AUTOTRACE trên SQLPLUS - Lấy Excution Plan từ SQL_ID
Views: 5531 Database Tutorials
Query Tuning 101 What to Look for in Autotrace Output
 
02:58
You're up and running with autotrace, looking at the actual execution plan for a query. Now the real work begins! What is it you're actually looking for in the execution plan? This video shows what you need to investigate and how to use the HotSpot feature of SQL Developer 4.1 to highlight parts of the query you need to pay attention to. ============================ The Magic of SQL with Chris Saxon Copyright © 2015 Oracle and/or its affiliates. Oracle is a registered trademark of Oracle and/or its affiliates. All rights reserved. Other names may be registered trademarks of their respective owners. Oracle disclaims any warranties or representations as to the accuracy or completeness of this recording, demonstration, and/or written materials (the “Materials”). The Materials are provided “as is” without any warranty of any kind, either express or implied, including without limitation warranties or merchantability, fitness for a particular purpose, and non-infringement.
Views: 7667 The Magic of SQL
Optimizing SQL Queries in Oracle - What is the Query Optimizer?
 
03:40
This video clip, on the Oracle Query Optimizer, is taken from my www.pluralsight.com course "Optimizing SQL Queries in Oracle". Click here to learn more about this course: http://www.pluralsight.com/courses/optimizing-sql-queries-oracle?utm_source=youtube&utm_medium=video&utm_campaign=authordemo.
Views: 1924 sheepsqueezersYT
Oracle Database 12c: Adaptive Execution Plans with Tom Kyte
 
05:42
Tom Kyte introduces adaptive execution plans followed by a demo. "Adaptive Plans" in SQL Tuning Guide" http://www.oracle.com/pls/topic/lookup?ctx=db121&id=TGSQL221 "Controlling Adaptive Optimization" http://www.oracle.com/pls/topic/lookup?ctx=db121&id=TGSQL257 "Generating and Displaying SQL Execution Plans" http://www.oracle.com/pls/topic/lookup?ctx=db121&id=TGSQL271 "Keeping Your Database Secure" http://www.oracle.com/pls/topic/lookup?ctx=db121&id=DBSEG009
Views: 13325 OracleDBVision
SQL: Explain Plan for knowing the Query performance
 
05:17
In this tutorial, you'll learn how to compare queries to know the better performance query..
Views: 93025 radhikaravikumar
ORACLE EXPLAIN PLAN FUNDAMENTALS
 
36:14
This Tutorial will explain basics of Oracle 11g EXPLAIN Plan by using this ppt & some hands-on in Oracle 11g R2 Database.This tutorial will include below topics. Understanding EXPLAIN plan. Set up & Use EXPLAIN Plan. Explain PLAN_TABLE & related scripts & DBMS_XPLAN.DISPLAY. Generate & View EXPLAIN Plan. Read & Interpret basics of EXPLAIN Plan. EXPLAIN PLAN limitations.
Views: 158645 Anindya Das
22 Basic Execution Plans
 
29:46
SQL Server 2012 Administration Essentials SQL Server 2014
DML Processing in an Oracle Database -  DBArch Video 8
 
09:07
This video explains the steps involved in processing a DML statement in an Oracle Database Server. Our Upcoming Online Course Schedule is available in the url below https://docs.google.com/spreadsheets/d/1qKpKf32Zn_SSvbeDblv2UCjvtHIS1ad2_VXHh2m08yY/edit#gid=0 Reach us at [email protected]
Views: 47327 Ramkumar Swaminathan
Query Tuning 101: Access vs. Filter Predicates In Execution Plans
 
02:08
Have you ever wondered what the difference is between the "filter predicates" or "access predicates" steps listed in execution plans - or even what a predicate is? If so, watch this video to find out! Copyright © 2015 Oracle and/or its affiliates. Oracle is a registered trademark of Oracle and/or its affiliates. All rights reserved. Other names may be registered trademarks of their respective owners. Oracle disclaims any warranties or representations as to the accuracy or completeness of this recording, demonstration, and/or written materials (the “Materials”). The Materials are provided “as is” without any warranty of any kind, either express or implied, including without limitation warranties or merchantability, fitness for a particular purpose, and non-infringement.
Views: 4673 The Magic of SQL
Why Is My Query Slow? More Reasons Storing Dates as Numbers Is Bad
 
05:25
Storing dates as numbers can cause unexpected problems. In this video Chris looks at one possible issue: inconsistent query performance. He then shows methods you can use to improve performance, including function-based indexes and histograms. ============================ The Magic of SQL with Chris Saxon Copyright © 2015 Oracle and/or its affiliates. Oracle is a registered trademark of Oracle and/or its affiliates. All rights reserved. Other names may be registered trademarks of their respective owners. Oracle disclaims any warranties or representations as to the accuracy or completeness of this recording, demonstration, and/or written materials (the “Materials”). The Materials are provided “as is” without any warranty of any kind, either express or implied, including without limitation warranties or merchantability, fitness for a particular purpose, and non-infringement.
Views: 6668 The Magic of SQL
Slow SQL Query? Get the Plan in Oracle SQL Developer!
 
15:38
See how to get execution and explain plans, format and views those plans, use AutoTrace, and Real Time SQL Monitoring for your SQL queries in Oracle SQL Developer.
Views: 1932 Jeff Smith
Oracle SQL Tuning - Oracle Execution Plans for Beginners
 
13:39
For More Tutorials Related To Cisco,CCNA,Microsoft,Oracle,HP,Adobe,IBM,Java And Much More Please Visit This Site http://www.geteveryvideos.com/category/certification-tutorials/
OracleSQL#17 How Oracle SQL Query Work Internally
 
08:54
explaining how select SQL statement executes internally in Oracle database Or In other words how select statement retrieves data from the database Or ow a SELECT statement process query in Oracle Database Or Order of Query Execution In OracleSQL, SQL Parsing, SQL Optimization, row source generation, and SQL execution. In this series we cover the following topics: SQL basics, create table oracle, SQL functions, SQL queries, SQL server, SQL developer installation, Oracle database installation, SQL Statement, OCA, Data Types, Types of data types, SQL Logical Operator, SQL Function,Join- Inner Join, Outer join, right outer join, left outer join, full outer join, self-join, cross join, View, SubQuery, Set Operator. follow me on: Facebook Page: https://www.facebook.com/LrnWthr-319371861902642/?ref=bookmarks Contacts Email: [email protected] Instagram: https://www.instagram.com/lrnwthr/ Twitter: https://twitter.com/LrnWthR
Views: 209 EqualConnect Coach
sql query optimization by using SQL server query execution plan
 
53:19
SQL server query execution plan- sql query optimization by using SQL server query execution plan
Oracle DBA - Solve Long Running Query & TX Row Lock Contention | Performance Tuning
 
09:19
How to Solve Row Lock Contention in Oracle Database - Performance Tuning - Oracle DBA Solve Row Lock Contention & Long Running Query in Oracle Database - Performance Tuning Oracle DBA - Performance Tuning Row Lock Contention Please Like, Comment, Subscribe and Share... Boxcut Media.
Views: 5131 BoxCut Media
how to run sql query in oracle 11g | version 2 |
 
05:10
how to sql queries using oracle database
Views: 1451 Education 4u
Query Tuning 101 How to Run Autotrace in SQL Developer
 
02:21
This video shows how to run autotrace reports using Oracle SQL Developer to analyze query performance. It also discusses the privileges you need to enable database users to run autotrace. ============================ The Magic of SQL with Chris Saxon Copyright © 2015 Oracle and/or its affiliates. Oracle is a registered trademark of Oracle and/or its affiliates. All rights reserved. Other names may be registered trademarks of their respective owners. Oracle disclaims any warranties or representations as to the accuracy or completeness of this recording, demonstration, and/or written materials (the “Materials”). The Materials are provided “as is” without any warranty of any kind, either express or implied, including without limitation warranties or merchantability, fitness for a particular purpose, and non-infringement.
Views: 17640 The Magic of SQL
Query Execution Plans
 
06:56
SQL Server Unlocked Series- Query Execution Plans In this video, we will be discussing query execution plans and how to use them properly. In this video, Morelan starts out with an analogy relating SQL Server to your kid. I know this sounds pretty far-fetched, but he has a point, so give it a chance. He goes on to describe how you want SQL Server to perform to the best of its ability, same as you would want your kids to do, hence why we use query execution plans. Additionally, If you lose something such as your keys, you probably want a tool that shows you how to find that item, if you set up your SQL server right, this is just the tool- not to find the keys but to find data. All-in-all SQL server can save you time if you use it right and you know how to use it right. This mini-series is a good starter on how to do so. Have a look at the video, and if you want to learn more, take our class Developer 2012 Volume 3 Video 9.1. See more at: http://www.joes2pros.com/joes2pros/courses Full Blog: http://joes2prosblog.social27.com/
sql query processing in oracle database
 
05:01
sql query processing in oracle database
Obtaining Execution Plan in Oracle
 
05:11
Obtaining Execution Plan in Oracle with demostration.
Views: 350 Expert-Oracle.com
Interpreting Oracle Explain Plan Output - John Mullins
 
01:00:16
Themis Instructor John Mullins presents some details on interpreting Oracle Database Explain Plan output. For more information visit http://www.themisinc.com
Views: 43837 Themis Education
Why Use Parallel Processing?
 
03:20
This video compares the use of parallel and serial processing for the same SQL query. Copyright © 2012 Oracle and/or its affiliates. Oracle® is a registered trademark of Oracle and/or its affiliates. All rights reserved. Oracle disclaims any warranties or representations as to the accuracy or completeness of this recording, demonstration, and/or written materials (the "Materials"). The Materials are provided "as is" without any warranty of any kind, either express or implied, including without limitation warranties of merchantability, fitness for a particular purpose, and non-infringement.
Using DBMS_XPLAN.DISPLAY_CURSOR to examine execution plans
 
12:33
In this video I describe how you can use Oracle's DBMS_XPLAN.DISPLAY_CURSOR to examine the execution plan for a SQL statement that has recently been executed and determine if that plan is optimal or not and where you might be able to optimize it.
Views: 6830 Maria Colgan
Uipath - SQL database Query Execution in uipath
 
03:42
this video shows you how to execute sql query using uipath
Oracle SQL Developer: Query Builder Demo
 
08:13
How to build queries with your mouse versus the keyboard.
Views: 68124 Jeff Smith
Oracle Database Performance Tuning for Admins and Architects
 
48:59
Product manager Randal Sagrillo asks you to be a hero as an administrator or architect in the practice of performance tuning!
How Oracle SQL Query Process
 
39:10
For complete professional training visit at: http://www.bisptrainings.com/course/Oracle-Fundamentals-and-PL-SQL-for-beginners Follow us on Facebook: https://www.facebook.com/bisptrainings/ Follow us on Twitter: https://twitter.com/bisptrainings Email: [email protected] Call us: +91 975-275-3753 or +1 386-279-6856
Views: 22923 Amit Sharma
Pre-Query and Post-Query Triggers in Oracle Forms
 
08:27
Pre-Query and Post-Query Triggers in Oracle Forms An Example of Pre-Query and Post-Query Triggers in Oracle Forms
Views: 5040 Oracle Developer Tutz
Estimated & actual execution plans with SQL Query Tuning | Pluralsight
 
06:31
SQL Server Performance: Introduction to Query Tuning | http://www.pluralsight-training.net/microsoft/courses/TableOfContents?courseName=query-tuning-introduction It takes more than "Select *" to make a great SQL query. In this video excerpt from Vinod Kumar's and Pinal Dave's new course SQL Server Performance: Introduction to Query Tuning you'll see how to view the execution plans for your queries including the differences between estimated and actual plans as well as how your query hints can affect the execution plan in unforeseen ways. In the full course, the two go on to cover topics such as indexing techniques, how order of tables and query hints affect execution, and how to use various tools to optimize queries. Visit us at: Facebook: https://www.facebook.com/pluralsight Twitter: https://twitter.com/pluralsight Google+: https://plus.google.com/+pluralsight LinkedIn: https://www.linkedin.com/company/pluralsight Instagram: http://instagram.com/pluralsight Blog: http://blog.pluralsight.com/ 3,500 courses unlimited and online. Start your 10-day FREE trial now: https://www.pluralsight.com/a/subscribe/step1?isTrial=True Estimated & actual execution plans with SQL Query Tuning | Pluralsight -~-~~-~~~-~~-~- Push your limits. Expand your potential. Smarter than yesterday- https://www.youtube.com/watch?v=k2s77i9zTek -~-~~-~~~-~~-~-
Views: 14354 Pluralsight
Calculate query performance with Explain Plan in Oracle PLSQL.
 
09:14
Explain plan is a wonderful utility in Oracle PL SQL. It helps you to understand how much cost a query takes to perform based on indexed table or table without index. In this oracle tutorial a full description is given on a table containing huge number of rows first based on index on a column and then without index.
Views: 3606 Subhroneel Ganguly
Rewriting SQL queries for Performance in 9 minutes
 
09:10
ENGLISH CAPTIONS AVAILABLE - SPANISH SUBTITLES - Full transcript (with some screenshots) available for a small fee at http://stores.lulu.com/konagora/. A brief example about how you can improve query performance by analyzing and rewriting queries.
Views: 71364 roughsealtd
Oracle-performance-tuning-1.avi
 
08:53
How to show the execution plan for your Oracle SQL statements to help with your performance tuning activities. For more Oracle tutorials go to http://www.asktheoracle.net
Views: 39607 asktheoracle1
CASE STATEMENT(IF THEN ELSE) IN ORACLE SQL WITH EXAMPLE
 
06:28
The case statement gives the if-then-else kind of conditional ability to the otherwise static sql select statement, This video demonstrates how to write an case statement in oracle sql, and explains different aspects of the case statement. The video explains the execution flow of the case statement and advises on the best way to write one.
Views: 1692 Kishan Mashru
SQL Developer Query Builder : sqlvids
 
03:11
How to use Query Builder in SQL Developer? How to join tables, create outer join using LEFT, RIGHT and FULL join, restrict rows using WHERE clause and order rows using ORDER BY clause. More tutorials for beginners are on http://www.sqlvids.com
Views: 8224 sqlvids
SQL Server  Examinging Query Execution Plans, Pt. 1
 
10:04
3. Examinging Query Execution Plans, Pt. 1
Views: 9614 Eagle
1.Introduction to basic SQL*Plus and SQL commands in oracle 9i
 
20:41
A relational database management system (RDBMS) is a database management system (DBMS) that is based on the relational model as invented by E. F. Codd, of IBM's San Jose Research Laboratory. Many popular databases currently in use are based on the relational database model.RDBMSs have become a predominant choice for the storage of information in new databases used for financial records, manufacturing and logistical information, personnel data, and much more since the 1980s. Relational databases have often replaced legacy hierarchical databases and network databases because they are easier to understand and use. However, relational databases have been challenged by object databases, which were introduced in an attempt to address the object-relational impedance mismatch in relational database, and XML databases. Object-relational database management system (ORDBMS) ============================================ An object-relational database can be said to provide a middle ground between relational databases and object-oriented databases (OODBMS). In object-relational databases, the approach is essentially that of relational databases: the data resides in the database and is manipulated collectively with queries in a query language; at the other extreme are OODBMSes in which the database is essentially a persistent object store for software written in an object-oriented programming language, with a programming API for storing and retrieving objects, and little or no specific support for querying. Object-relational database management systems grew out of research that occurred in the early 1990s. That research extended existing relational database concepts by adding object concepts. The researchers aimed to retain a declarative query-language based on predicate calculus as a central component of the architecture. Probably the most notable research project, Postgres (UC Berkeley), spawned two products tracing their lineage to that research: Illustra and PostgreSQL. Many of the ideas of early object-relational database efforts have largely become incorporated into SQL:1999 via structured types. In fact, any product that adheres to the object-oriented aspects of SQL:1999 could be described as an object-relational database management product. For example, IBM's DB2, Oracle database, and Microsoft SQL Server, make claims to support this technology and do so with varying degrees of success. SQL(Structures Query Language) ======================== SQL was initially developed at IBM by Donald D. Chamberlin and Raymond F. Boyce in the early 1970s. This version, initially called SEQUEL (Structured English Query Language), was designed to manipulate and retrieve data stored in IBM's original quasi-relational database management system, System R, which a group at IBM San Jose Research Laboratory had developed during the 1970s.The acronym SEQUEL was later changed to SQL because "SEQUEL" was a trademark of the UK-based Hawker Siddeley aircraft company. SQL*Plus ======= SQL*Plus is a command line SQL and PL/SQL language interface and reporting tool that ships with the Oracle Database Client and Server software. It can be used interactively or driven from scripts. SQL*Plus is frequently used by DBAs and Developers to interact with the Oracle database. If you are familiar with other databases, sqlplus is equivalent to: "sql" in Ingres, "isql" in Sybase and SQL Server, "sqlcmd" in Microsoft SQL Server, "db2" in IBM DB2, "psql" in PostgreSQL, and "mysql" in MySQL.
Views: 44485 DASARI TUTS
The Basics of Execution Plans and SHOWPLAN in SQL Server
 
21:16
This video is part of LearnItFirst's Transact-SQL Programming: SQL Server 2008/R2 course. More information on this video and course is available here: http://www.learnitfirst.com/Course161 Many of the ideas in this video will be revisited in chapters 5 and 11, so expect mostly basics here - details will come in later videos. Using the query from the last video, trainer Scott Whigham discusses execution plans. How can you uncover the steps SQL Server went through to arrive at the results? What is SHOWPLAN? Highlights from this video: - What does the execution plan tell us? - How can you look at the execution plan? - Estimated Execution Plan vs. Actual Execution Plan - How does SQL Server choose indexes? - Analyzing and understanding graphical execution plans - Determining costs of the components of execution - Using SHOWPLAN and much more...
Views: 82823 LearnItFirst.com
Sql server query plan cache
 
14:20
Text version of the video http://csharp-video-tutorials.blogspot.com/2017/04/sql-server-query-plan-cache.html Slides http://csharp-video-tutorials.blogspot.com/2017/04/sql-server-query-plan-cache_12.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All SQL Server Tutorial Videos https://www.youtube.com/playlist?list=PL08903FB7ACA1C2FB All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists In this video we will discuss 1. What happens when a query is issued to SQL Server 2. How to check what is in SQL Server plan cache 3. Things to consider to promote query plan reusability What happens when a query is issued to SQL Server In SQl Server, every query requires a query plan before it is executed. When you run a query the first time, the query gets compiled and a query plan is generated. This query plan is then saved in sql server query plan cache. Next time when we run the same query, the cached query plan is reused. This means sql server does not have to create the plan again for that same query. So reusing a query plan can increase the performance. How long the query plan stays in the plan cache depends on how often the plan is reused besides other factors. The more often the plan is reused the longer it stays in the plan cache. How to check what is in SQL Server plan cache SELECT cp.usecounts, cp.cacheobjtype, cp.objtype, st.text, qp.query_plan FROM sys.dm_exec_cached_plans AS cp CROSS APPLY sys.dm_exec_sql_text(plan_handle) AS st CROSS APPLY sys.dm_exec_query_plan(plan_handle) AS qp ORDER BY cp.usecounts DESC As you can see we have sorted the result set by usecounts column in descending order, so we can see the most frequently reused query plans on the top. usecounts - Number of times the plan is reused objtype - Specifies the type of object text - Text of the SQL query query_plan - Query execution plan in XML format To remove all elements from the plan cache use the following command DBCC FREEPROCCACHE In older versions of SQL Server up to SQL Server 6.5 only stored procedure plans are cached. The query plans for Adhoc sql statements or dynamic sql statements are not cached, so they get compiled every time. With SQL Server 7, and later versions the query plans for Adhoc sql statements and dynamic sql statements are also cached. Things to consider to promote query plan reusability For example, when we execute the following query the first time. The query is compiled, a plan is created and put in the cache. Select * From Employees Where FirstName = 'Mark' When we execute the same query again, it looks up the plan cache, and if a plan is available, it reuses the existing plan instead of creating the plan again which can improve the performance of the query. However, one important thing to keep in mind is that, the cache lookup is by a hash value computed from the query text. If the query text changes even slightly, sql server will not be able to reuse the existing plan. For example, even if you include an extra space somewhere in the query or you change the case, the query text hash will not match, and sql server will not be able find the plan in cache and ends up compiling the query again and creating a new plan. Another example : If you want the same query to find an employee whose FirstName is Steve instead of Mark. You would issue the following query Select * From Employees Where FirstName = 'Steve' Even in this case, since the query text has changed the hash will not match, and sql server will not be able find the plan in cache and ends up compiling the query again and creating a new plan. This is why, it is very important to use parameterised queries for sql server to be able to reuse cached query plans. With parameterised queries, sql server will not treat parameter values as part of the query text. So when you change the parameters values, sql server can still reuse the cached query plan. The following query uses parameters. So even if you change parameter values, the same query plan is reused. Declare @FirstName nvarchar(50) Set @FirstName = 'Steve' Execute sp_executesql N'Select * from Employees where [email protected]', N'@FN nvarchar(50)', @FirstName One important thing to keep in mind is that, when you have dynamic sql in a stored procedure, the query plan for the stored procedure does not include the dynamic SQL. The block of dynamic SQL has a query plan of its own. Summary: Never ever concatenate user input values with strings to build dynamic sql statements. Always use parameterised queries which not only promotes cached query plans reuse but also prevent sql injection attacks.
Views: 21945 kudvenkat

Writing service testimonials
Job cover letter opening greeting
Web content writing service
I am writing to complain about the service you
Wolfe and associates application letters