An important aspect of query processing is query optimization. As there are many
equivalent transformations of the same high-level query, the aim of query optimization
is to choose the one that minimizes resource usage. Generally, we try to reduce the total
execution time of the query, which is the sum of the execution times of all individual
operations that make up the query (Selinger et al., 1979). However, resource usage may
also be viewed as the response time of the query, in which case we concentrate on
maximizing the number of parallel operations (Valduriez and Gardarin, 1984). Since the
problem is computationally intractable with a large number of relations, the strategy
adopted is generally reduced to finding a near optimum solution (Ibaraki and Kameda,
1984).
Both methods of query optimization depend on database statistics to evaluate properly
the different options that are available. The accuracy and currency of these statistics
have a significant bearing on the efficiency of the execution strategy chosen. The statistics
cover information about relations, attributes, and indexes. For example, the system catalog
may store statistics giving the cardinality of relations, the number of distinct values for
each attribute, and the number of levels in a multilevel index (see Appendix C.5.4).
Keeping the statistics current can be problematic. If the DBMS updates the statistics
every time a tuple is inserted, updated, or deleted, this would have a significant impact on
performance during peak periods. An alternative, and generally preferable, approach is
to update the statistics on a periodic basis, for example nightly, or whenever the system is
idle. Another approach taken by some systems is to make it the users’ responsibility to
indicate when the statistics are to be updated. We discuss database statistics in more detail
in Section 21.4.1.
As an illustration of the effects of different processing strategies on resource usage, we
start with an example.
An important aspect of query processing is query optimization. As there are many
equivalent transformations of the same high-level query, the aim of query optimization
is to choose the one that minimizes resource usage. Generally, we try to reduce the total
execution time of the query, which is the sum of the execution times of all individual
operations that make up the query (Selinger et al., 1979). However, resource usage may
also be viewed as the response time of the query, in which case we concentrate on
maximizing the number of parallel operations (Valduriez and Gardarin, 1984). Since the
problem is computationally intractable with a large number of relations, the strategy
adopted is generally reduced to finding a near optimum solution (Ibaraki and Kameda,
1984).
Both methods of query optimization depend on database statistics to evaluate properly
the different options that are available. The accuracy and currency of these statistics
have a significant bearing on the efficiency of the execution strategy chosen. The statistics
cover information about relations, attributes, and indexes. For example, the system catalog
may store statistics giving the cardinality of relations, the number of distinct values for
each attribute, and the number of levels in a multilevel index (see Appendix C.5.4).
Keeping the statistics current can be problematic. If the DBMS updates the statistics
every time a tuple is inserted, updated, or deleted, this would have a significant impact on
performance during peak periods. An alternative, and generally preferable, approach is
to update the statistics on a periodic basis, for example nightly, or whenever the system is
idle. Another approach taken by some systems is to make it the users’ responsibility to
indicate when the statistics are to be updated. We discuss database statistics in more detail
in Section 21.4.1.
As an illustration of the effects of different processing strategies on resource usage, we
start with an example.
การแปล กรุณารอสักครู่..

กว้างยาวสำคัญของการประมวลผลแบบสอบถามเป็นแบบสอบถามที่ปรับให้เหมาะสม มีการแปลงเทียบเท่าหลาย
ของแบบสอบถามพื้นฐานเดียวกัน จุดมุ่งหมายของการ query Optimization
คือการเลือกหนึ่งที่ช่วยลดการใช้ทรัพยากร โดยทั่วไปเราพยายามที่จะลดการรวม
เวลาแบบสอบถามซึ่งเป็นผลรวมของการดำเนินงานแต่ละครั้งของ
ที่ทำให้แบบสอบถาม ( selinger et al . ,1979 ) อย่างไรก็ตาม การใช้ทรัพยากรอาจ
ยังถูกมองว่าเป็นเวลาตอบสนองของแบบสอบถาม ซึ่งในกรณีนี้เราตั้งใจ
เพิ่มงานแบบขนาน ( valduriez และ gardarin , 1984 ) เนื่องจากมีปัญหาที่หาทางออกไม่เจอ
computationally กับจำนวนมากของความสัมพันธ์ , กลยุทธ์
รับโดยทั่วไปลดลงเพื่อหาโซลูชั่นที่เหมาะสม ( และใกล้กลับคาเมดะ
1984 )ค้นหาการเพิ่มประสิทธิภาพของทั้งสองวิธีขึ้นอยู่กับสถิติประเมินอย่างถูกต้อง
ตัวเลือกที่แตกต่างกันที่มีอยู่ ความถูกต้องและสกุลเงินเหล่านี้สถิติ
มีผลกระทบอย่างมีนัยสำคัญต่อประสิทธิภาพของกลยุทธ์การเลือก สถิติ
ครอบคลุมข้อมูลเกี่ยวกับความสัมพันธ์ระหว่าง คุณสมบัติ และดัชนี ตัวอย่างเช่น
รายการระบบอาจจะเก็บสถิติให้ภาวะเชิงการนับของความสัมพันธ์ , จํานวนของค่าที่แตกต่างกันสำหรับแต่ละแอตทริบิวต์
และจำนวนของระดับดัชนีหลายระดับ ( ดู c.5.4 ภาคผนวก ) .
รักษาสถิติปัจจุบันจะมีปัญหามาก ถ้า DBMS ปรับปรุงสถิติ
ทุกครั้งที่เป็นทูเปิลจะถูกแทรก , ปรับปรุงหรือลบ นี้จะมีผลกระทบต่อประสิทธิภาพในช่วงระยะเวลาสูงสุด
.ทางเลือก , และโดยทั่วไปกว่า วิธีการคือ
มา update สถิติเป็นระยะ เช่นทุกคืน หรือเมื่อใดก็ตามที่ระบบ
ไม่ได้ใช้งาน แนวทางหนึ่งที่ถ่ายโดยบางระบบจะให้ผู้ใช้ระบุความรับผิดชอบ
เมื่อสถิติที่ต้องปรับปรุง เราจะหารือในรายละเอียดเพิ่มเติมในฐานข้อมูลสถิติ
ส่วน 21.4.1 .เป็นภาพประกอบของผลกระทบของกลยุทธ์การประมวลผลที่แตกต่างกันในการใช้ทรัพยากร เรา
เริ่มต้นด้วยตัวอย่าง
การแปล กรุณารอสักครู่..
