`

《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
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics