`

《Pro Oracle SQL》Chapter2--2.13 SQL Execution – Putting It All Together

阅读更多

SQL Execution – Putting It All Together   SQL执行--把所有放在一起 (page 81)
    Now that I’ve covered the details, I’m ready to put the whole picture of how a SQL statement executes together.  Figure 2-4 shows the steps that are involved when a SQL statement executes. 
    既然我已经详述过了,我准备把SQL语句如何执行的整体(流程)图整合在一起。图2-4展示了当一SQL语句执行时所涉及的步骤。
Figure 2-4
    This is a simplified view, but it encapsulates the view of the process.  From a big picture perspective, every query must complete  PARSE ,  EXECUTE  and FETCH  steps.  DML statements ( INSERT, UPDATE, DELETE) will only need to parse and exectue. In addition to these steps, statements that use bind variables will also include a step to read the bind values as part of the parse component.
    这是一个简图,但是它封装了流程图。从一幅画的角度看,每个查询必须完成PARSE(解析),  EXECUTE(执行)  和 FETCH(取数据)步骤。DML语句 (INSERT, UPDATE, DELETE) 只需要解析和执行。除去这些步骤,若语句使用绑定变量的也还包含一步去读取绑定值而作为解析组件的一部分。
   
Summary
    Understanding how SQL executes will enable you to write it more effectively. The optimizer is at the heart of every SQL statement you write;writing SQL with the optimizer in mind will help you more than you can imagine. On this point, I'll ask you to trutst me for now. I can assure you that understanding the optimizer has been one of the most beneficial pieces of knowlege I've gained. So, don't get frustrated if you're itching to just start looking at syntax and specific SQL code. What you'll end up with by the end of this joureny will be well worth it.
    理解SQL如何运行将使你能把它写的更有效率。优化器作用在你所写每条SQL语句的“内心”中;写SQL时考虑到优化器会给予你超出你想象的好处。在这一点上,现在请信任我。我能向你保证理解优化器是我所获得最优价值的知识之一。所以,不要沮丧如果你开始急于查询语法和特定的SQL代码。在这趟学习旅程结束时你将发现它很值得。
    At this point, I hope you feel more comfortable with at least some of the key parts of Oracle's architecture that are involved in the execution of the SQL you send to the database. You should also have a flavor for the power of statistices and how they are used by optimizer. It is outside the scope of this book to go into more detail about this topic, but I'd highly recommend picking up Jonathan Lewis' Cost-Based Oracle Fundamentals if you really want to take a deep dive into this subject matter. The more you know, the better equipped you'll be write SQL that works with the optimizer and not against it.
    此刻,我希望你对发送给数据库执行SQL所涉及到的一些Oracle架构的关键部分感觉“舒适”多了。你也应该对统计的力量和他们如何被优化器使用有所领悟。更详细的讨论这个主题已经超出本书的范围,但是我强烈推荐选择Jonathan Lewis的《Cost-Based Oracle Fundamentals》如果你真想深入这一主题。 你知道的越多,越有能力写出同优化器协调的而不是违背它的SQL。
    In the chapter ahead, I'm going to cover the access and join methods the optimizer can choose and review numerous examples of how and why the optimizer does what it does. What I've covered so far has built the foundation for what I'll cover next and each chapter will continue to add to the foundation.The goal is to shed some light on the black box into which you've been throwing SQL and to help you develop and enriched perspective on the importance of what's under the covers of Oracle, in particular the optimizer, and how properly interact with it.
   在后面的章节中,我将讲解优化器能选择的访问和连接方法然后讨论很多如何和为什么优化器会这样做的例子。我到现在为止所讲述的这些知识构建了后续章节的基础且每一章都将不断的巩固这个基础。目标是向你抛出SQL的黑盒散发一些光芒,帮助你开发和充实Oracle面罩之下重要性的观点,特别是优化器,以及如何适当的同它交互。

  • 大小: 47.2 KB
2
0
分享到:
评论

相关推荐

    《Pro Oracle SQL》 读书笔记--Chapter 6--6.2 Execution Plans--之四

    《Pro Oracle SQL》是Oracle数据库查询优化的经典之作,第六章主要聚焦在Execution Plans(执行计划)上,这是数据库查询性能优化的关键。本章节的第四部分深入探讨了如何理解和解析执行计划,以及它对SQL性能的影响...

    《Pro Oracle SQL》Chapter10 -- 10.2 Optimizing SQL -10.2.1Testing Execution Plans

    《Pro Oracle SQL》一书的第10章深入探讨了SQL优化,特别是10.2节,重点关注如何测试执行计划,这是SQL性能调优的关键环节。在这个部分,作者旨在帮助读者理解如何有效地评估和改进SQL查询的性能,以提高数据库系统...

    Pro Oracle SQL

    Pro Oracle SQL unlocks the power of SQL in the Oracle Database—one of the most potent SQL implementations on the market today. To master it requires a three-pronged approach: learn the language ...

    Oracle SQL Tuning with Oracle SQLTXPLAIN: Oracle Database 12c Edition

    Oracle SQL Tuning with Oracle SQLTXPLAIN: Oracle Database 12c Edition by Stelios Charalambides English | 8 May 2017 | ISBN: 1484224353 | 408 Pages | PDF | 24.39 MB Learn through this practical guide ...

    DBA对Oracle SQL编写规范的总结

    ### DBA对Oracle SQL编写规范的总结 #### 一、引言 在Oracle数据库开发过程中,遵循一套标准化的SQL编写规范对于提升代码质量、增强可读性和可维护性至关重要。本文档由一位经验丰富的数据库管理员(DBA)撰写,旨在...

    ORACLE并行SQL指南

    ### Oracle并行SQL指南 #### 一、理解并行SQL的概念 在Oracle数据库中,并行SQL(Parallel SQL)是一种能够显著提升SQL语句执行效率的技术。传统的串行SQL执行方式中,一个会话只能利用一个CPU核心或者一个磁盘...

    sql-server-2016-samples,SQL SERVER 2016 脚本例子

    在SQL Server 2016中,数据库管理系统(DBMS)提供了一系列强大的功能,使得数据管理、查询和分析更为高效。这个"sql-server-2016-samples"压缩包包含的是针对SQL Server 2016的一系列示例脚本,是学习和理解SQL ...

    Biblio.Distribution.C++.For.Artists.The.Art.Philosophy.and.Science.of.Object-Oriented.Programming.2003.chm

    Chapter 2 - Small Victories—Creating Projects With IDE’s Chapter 3 - Project Walkthrough—An Extended Example Chapter 4 - Computers, Programs, & Algorithms Part II - C++ Language Chapter 5 ...

    Oracle Database 10g PL-SQL Programming

    ### Oracle Database 10g PL/SQL Programming #### 1. Introduction to PL/SQL PL/SQL (Procedural Language for SQL) is a procedural extension to SQL that provides a powerful way to manipulate data within...

    oracle-Execution_plan脚本运行配置-010.doc

    ### Oracle 执行计划(Execution Plan)配置与管理 #### 一、概述 Oracle数据库中的执行计划是指数据库系统根据SQL查询语句所选择的最佳查询路径。它对于提高查询效率至关重要。本文将详细介绍如何通过创建索引、...

    Oracle-Pl-Sql.rar

    2. **PL/SQL块结构**:PL/SQL程序由三种类型的块组成:声明部分(DECLARATION)、执行部分(EXECUTION)和异常处理部分(EXCEPTION)。理解这些块的结构是编写有效PL/SQL代码的关键。 3. **游标(CURSOR)**:游标...

    Oracle的PL-SQL编程手册

    Oracle的PL-SQL编程是数据库管理员和开发人员在构建高效、可维护的Oracle数据库应用程序时不可或缺的工具。PL/SQL,全称为Procedural Language/Structured Query Language,是Oracle数据库支持的一种过程化语言,它...

    pl-sql-dev-8.rar

    PL/SQL是Oracle数据库系统中的一个关键组成部分,它是一种结合了SQL和过程编程的语言,用于在Oracle环境中编写存储过程、函数、触发器等数据库管理任务。"pl-sql-dev-8.rar"是一个压缩包,包含了PL/SQL Developer的...

    oracle执行动态sql

    ### Oracle 执行动态 SQL 的几种方法 在数据库管理和应用程序开发中,经常需要处理不固定、不可预知的数据查询和更新需求。此时,静态 SQL(即硬编码的 SQL 语句)无法满足这些灵活多变的需求,这就需要使用动态 ...

    gradle-2.13-bin.zip

    2. **Gradle在Android开发中的应用**:在Android Studio中,Gradle是默认的构建系统,负责编译、打包、测试和部署Android应用。开发者可以通过修改`build.gradle`文件来定制构建过程,例如添加依赖库、设置版本控制...

    Getting.started.with.Spring.Framework.2nd.Edition1491011912.epub

    You can download the examples (consisting of 60 sample projects) described in this book from the following Google Code project: code.google.com/p/getting-started-with-spring-framework-2edition/ ...

    SQL Server 2014 Development Essentials - Masood-Al-Farooq, Basit A. [SRG].pdf

    Chapter 2, Understanding DDL and DCL Statements in SQL Server, introduces the reader to the SQL Server 2014 Transact-SQL language elements and SQL Server 2014 Management Studio (SSMS 2014). This ...

    oracle_oracle_oraclepl/sql_

    Oracle PL/SQL是一种强大的编程语言,它结合了SQL(结构化查询语言)的数据库操作能力和过程性编程语言的控制结构。在"Oracle PL/SQL"这本书中,作者深入浅出地探讨了这一语言的核心概念和实用技巧,尤其适合法语...

    慢sql监控mysql及oracle.pdf

    数据库监控 MySQL 及 Oracle 数据库监控是指对数据库的运行状态和性能进行监控和优化,以确保数据库的稳定运行和高效运作。MySQL 和 Oracle 是两种常用的数据库管理系统,本文将介绍 MySQL 和 Oracle 的慢查询监控...

Global site tag (gtag.js) - Google Analytics