Query processing can be divided into four main phases: decomposition (consisting
of parsing and validation), optimization, code generation, and execution, as illustrated in
Figure 21.1. In Section 21.2 we briefly examine the first phase, decomposition, before
turning our attention to the second phase, query optimization. To complete this overview,
we briefly discuss when optimization may be performed.
Dynamic versus static optimization
There are two choices for when the first three phases of query processing can be carried
out. One option is to dynamically carry out decomposition and optimization every time the
query is run. The advantage of dynamic query optimization arises from the fact that all
information required to select an optimum strategy is up to date. The disadvantages are
that the performance of the query is affected because the query has to be parsed, validated,
and optimized before it can be executed. Further, it may be necessary to reduce the number
of execution strategies to be analyzed to achieve an acceptable overhead, which may
have the effect of selecting a less than optimum strategy.
The alternative option is static query optimization, where the query is parsed, validated,
and optimized once. This approach is similar to the approach taken by a compiler
for a programming language. The advantages of static optimization are that the runtime
การประมวลผลข้อมูลสามารถแบ่งออกเป็นสี่ขั้นตอนหลัก ประกอบด้วยการสลาย
และตรวจสอบ ) , การเพิ่มประสิทธิภาพ , รหัสรุ่น และการดําเนินการ ตามที่แสดงในรูป 21.1
. ในส่วนที่เราสั้น ๆตรวจสอบลบเฟสแรกการสลายตัวก่อนที่
เปลี่ยนความสนใจของเราไปที่ขั้นตอนที่สอง , ค้นหาการเพิ่มประสิทธิภาพ เพื่อให้ภาพรวมนี้
เราสั้นหารือเกี่ยวกับเมื่อการเพิ่มประสิทธิภาพอาจจะแสดงแบบไดนามิกและ
.
เพิ่มประสิทธิภาพคงที่มีสองทางเลือกเมื่อสามขั้นตอนแรกของการประมวลผลแบบสอบถามสามารถใช้
. เป็นทางเลือกหนึ่งในการเพิ่มประสิทธิภาพแบบไดนามิกและเนินทุกครั้ง
query คือวิ่ง ประโยชน์ของการเพิ่มประสิทธิภาพแบบสอบถามแบบไดนามิกที่เกิดขึ้นจากความจริงที่ว่าทุกคน
ข้อมูลที่จำเป็นเพื่อเลือกกลยุทธ์ที่เหมาะสมอยู่เสมอ ข้อเสีย
ที่ประสิทธิภาพของแบบสอบถามเป็นแบบสอบถามได้รับผลกระทบ เพราะต้องวิเคราะห์ตรวจสอบ ,
, และปรับให้เหมาะสม ก่อนที่จะถูกประหาร ต่อไปอาจจะต้องมีการลดจำนวนของกลยุทธ์การ
มาวิเคราะห์เพื่อให้ได้ค่าใช้จ่ายที่ยอมรับได้ ซึ่งอาจ
ได้ผลของการเลือกกลยุทธ์ที่เหมาะสมน้อยกว่า .
ตัวเลือกอื่นคือการเพิ่มประสิทธิภาพแบบสอบถามสถิตที่แบบสอบถามวิเคราะห์ตรวจสอบ ,
, และปรับให้เหมาะสมอีกครั้ง วิธีการนี้จะคล้ายกับวิธีการถ่ายโดยคอมไพเลอร์
สำหรับการเขียนโปรแกรมภาษา ข้อดีของการเพิ่มประสิทธิภาพรันไทม์ที่คงที่
การแปล กรุณารอสักครู่..
![](//thimg.ilovetranslation.com/pic/loading_3.gif?v=b9814dd30c1d7c59_8619)