maintains the relationships between a foreign key with its matching primary keys. In the context of a star schema, a join index can relate the values of one or more attributes of a dimension table to matching rows in the fact table. For example, consider the schema of Figure 3. There can be a join index on City that maintains, for each city, a list of RIDs of the tuples in the fact table that correspond to sales in that city. Thus a join index essentially precomputes a binary join. Multikey join indices can represent precomputed n-way joins. For example, over the Sales database it is possible to construct a multidimensional join index from (Cityname, Productname) to the fact table. Thus, the index entry for (Seattle, jacket) points to RIDs of those tuples in the Sales table that have the above combination. Using such a multidimensional join index can sometimes provide savings over taking the intersection of separate indices on Cityname and Productname. Join indices can be used with bitmap representations for the RID lists for efficient join processing12. Finally, decision support databases contain a significant amount of descriptive text and so indices to support text search are useful as well. Materialized Views and their Usage Many queries over data warehouses require summary data, and, therefore, use aggregates. Hence, in addition to indices, materializing summary data can help to accelerate many common queries. For example, in an investment environment, a large majority of the queries may be based on the performance of the most recent quarter and the current fiscal year. Having summary data on these parameters can significantly speed up query processing. The challenges in exploiting materialized views are not unlike those in using indices: (a) identify the views to materialize, (b) exploit the materialized views to answer queries, and (c) efficiently update the materialized views during load and refresh. The currently adopted industrial solutions to these problems consider materializing views that have a relatively simple structure. Such views consist of joins of the fact table with a subset of dimension tables (possibly after some selections on those dimensions), with the aggregation of one or more measures grouped by a set of attributes from the dimension tables. The structure of these views is a little more complex when the underlying schema is a snowflake. Despite the restricted form, there is still a wide choice of views to materialize. The selection of views to materialize must take into account workload characteristics, the costs for incremental update, and upper bounds on storage requirements. Under simplifying assumptions, a greedy algorithm was shown to have good performance13. A related problem that underlies optimization as well as choice of materialized views is that of estimating the effect of aggregation on the cardinality of the relations. A simple, but extremely useful, strategy for using a materialized view is to use selection on the materialized view, or rollup on the materialized view by grouping and aggregating on additional columns. For example, assume that a materialized view contains the total sales by quarter for each product. This materialized view can be used to answer a query that requests the total sales of Levi’s jeans for the year by first applying the selection and then rolling up from quarters to years. It should be emphasized that the ability to do roll-up from a partially aggregated result, relies on algebraic properties of the aggregating functions (e.g., Sum can be rolled up, but some other statistical function may not be). In general, there may be several candidate materialized views that can be used to answer a query. If a view V has the same set of dimensions as Q, if the selection clause in Q implies the selection clause in V, and if the group-by columns in V are a subset of the group-by columns in Q, then view V can act as a generator of Q. Given a set of materialized views M, a query Q, we can define a set of minimal generators M’ for Q (i.e., smallest set of generators such that all other generators generate some member of M’). There can be multiple minimal generators for a query. For example, given a query that asks for total sales of clothing in Washington State, the following two views are both generators: (a) total sales by each state for each product (b) total sales by each city for each category. The notion of minimal generators can be used by the optimizer to narrow the search for the appropriate materialized view to use. On the commercial side, HP Intelligent Warehouse pioneered the use of the minimal generators to answer queries. While we have defined the notion of a generator in a restricted way, the general problem of optimizing queries in the presence of multiple materialized views is more complex. In the special case of Select-Project-Join queries, there has been some work in this area.14 15 16 Transformation of Complex SQL Queries The problem of finding efficient techniques for processing complex queries has been of keen interest in query optimization. In a way, decision support systems provide a testing ground for some of the ideas that have been studied before. We will only summarize some of the key contributions. There has been substantial work on “unnesting” complex SQL queries containing nested subqueries by translating them into single block SQL queries when certain syntactic restrictions are satisfied17 18 19 20. Another direction that has been pursued in optimizing nested subqueries is reducing the number of invocations and batching invocation of inner
รักษาความสัมพันธ์ระหว่างคีย์ต่างประเทศกับคู่หลัก คีย์ ในบริบทของ Star Schema , เข้าร่วมดัชนีสามารถเชื่อมโยงคุณค่าของหนึ่งหรือมากกว่าหนึ่งแอททริบิวต์ของตารางมิติที่ตรงกับแถวในความจริงโต๊ะ ตัวอย่างเช่นพิจารณารูปแบบของรูปที่ 3 สามารถมีรวมดัชนีในเมืองที่ยังคงสำหรับแต่ละเมืองรายชื่อของ rids ของทูเปิลในความเป็นจริงตารางที่สอดคล้องกับการขายในเมืองนั้น จึงร่วมกับดัชนีเป็นหลัก precomputes เข้าร่วมไบนารี มัลติ คีย์ เข้าร่วมดัชนีสามารถแสดง precomputed n-way ร่วม . ตัวอย่างเช่น ผ่านการขายฐานข้อมูลก็เป็นไปได้ที่จะสร้างดัชนีร่วมจากหลายมิติ ( cityname ProductName , ) ความจริงโต๊ะ ดังนั้น รายการดัชนี ( ซีแอตเทิลเสื้อ ) จุด rids ของผู้ที่มีในการขายตารางที่มีการรวมกันดังกล่าวข้างต้น ใช้เช่นเข้าร่วมหลายมิติดัชนีบางครั้งสามารถให้ประหยัดกว่าการแยกดัชนีที่แยกต่างหากใน cityname และหู . ดัชนีที่สามารถใช้ร่วมกับบิตแมปที่ใช้แทนสำหรับรายการเพื่อเข้าร่วมจัด processing12 อย่างมีประสิทธิภาพ ในที่สุดฐานข้อมูลสนับสนุนการตัดสินใจประกอบด้วยจำนวนมากของข้อความเชิงพรรณนาและดัชนีเพื่อสนับสนุนการค้นหาข้อความที่มีประโยชน์เช่นกัน การพัฒนามุมมองและการใช้งานหลายแบบสอบถามผ่านคลังสินค้าข้อมูลต้องให้ข้อมูล สรุป และใช้มวลรวม . ดังนั้น นอกจากดัชนีรายข้อมูลสรุปสามารถช่วยเร่งสอบถามทั่วไปหลาย ตัวอย่างเช่นในสภาพแวดล้อมการลงทุนส่วนใหญ่ของแบบสอบถามอาจจะขึ้นอยู่กับประสิทธิภาพของไตรมาสล่าสุด และปีงบการเงินปัจจุบัน มีข้อมูลเกี่ยวกับพารามิเตอร์เหล่านี้อย่างมีนัยสำคัญสามารถเพิ่มความเร็วในการประมวลผลแบบสอบถาม ความท้าทายในการ exploiting materialized views จะไม่แตกต่างจากผู้ที่อยู่ในการใช้ดัชนี ( ) กำหนดมุมมองในรูปธรรม( ข ) ใช้ materialized views เพื่อตอบแบบสอบถาม และ ( c ) ได้อย่างมีประสิทธิภาพปรับปรุง materialized views ในระหว่างการโหลดและสดชื่น ปัจจุบันใช้วิธีแก้ไขปัญหาเหล่านี้ พิจารณารายอุตสาหกรรม มีความเห็นว่า มีโครงสร้างที่ค่อนข้างง่าย มุมมองดังกล่าวประกอบด้วยรวมข้อเท็จจริงของตารางที่มีบางส่วนของตารางมิติ ( อาจจะหลังจากการเลือกบางส่วนในมิตินั้น )กับการรวมตัวของหนึ่งหรือมากกว่าหนึ่งมาตรการแบ่งตามชุดของแอตทริบิวต์จากมิติตาราง โครงสร้างของมุมมองเหล่านี้เป็นเพียงเล็กน้อยซับซ้อนมากขึ้นเมื่อมีรูปแบบเป็นเกล็ดหิมะ แม้จะมีการ จำกัด รูปแบบ ยังคงมีตัวเลือกที่กว้างของมุมมองที่จะเกิดขึ้น การเลือกมุมมองที่เป็นจริง ต้องคำนึงถึงภาระงาน คุณลักษณะค่าใช้จ่ายเพื่อปรับปรุงเพิ่ม และขอบเขตบนความต้องการของการจัดเก็บ ภายใต้ระบบสมมติฐานวิธีโลภก็แสดงได้ดี performance13 . ที่เกี่ยวข้องกับปัญหาที่แผ่นอยู่ที่เหมาะสม ตลอดจนการเลือกมุมมองที่สามารถประเมินผลของการรวมตัวในภาวะเชิงการนับของความสัมพันธ์ ที่เรียบง่าย แต่มากประโยชน์กลยุทธ์สำหรับการใช้ materialized ดูคือการเลือกใช้ในการพัฒนามุมมอง หรืองานส่งเสริมการขาย โดยการดูที่ปรากฏร่วมกันในคอลัมน์เพิ่มเติม ตัวอย่างเช่น สมมติว่า materialized ดูมียอดขายโดยรวมสำหรับแต่ละผลิตภัณฑ์นี้สามารถดูสามารถใช้เพื่อตอบแบบสอบถามที่ให้ยอดขายรวมของกางเกงยีนส์ลีวายส์สำหรับปีแรกที่ใช้คัดเลือกแล้วกลิ้งขึ้นจากที่พักถึงปี มันควรจะเน้นที่ความสามารถในการทำม้วนขึ้นจากบางส่วนหรือการอาศัยคุณสมบัติทางพีชคณิตของฟังก์ชัน ( เช่น ปี รวม สามารถรีดขึ้นแต่บางอื่น ๆสถิติฟังก์ชั่นอาจจะไม่ ) โดยทั่วไปอาจจะมีผู้สมัครหลาย materialized views ที่สามารถใช้เพื่อตอบแบบสอบถาม ถ้าวิว 5 มีชุดเดียวกันมิติเป็น Q ถ้าเลือกข้อที่ถาม หมายถึงการกำหนดใน V , และถ้ากลุ่มคอลัมน์ใน V เป็นเซตย่อยของกลุ่มโดยในคอลัมน์ Q แล้วดู V สามารถทำหน้าที่เป็นเครื่องกำเนิดไฟฟ้าของ Qได้รับชุดของ materialized views M , แบบสอบถาม Q เราสามารถกำหนดชุดของเครื่องน้อยที่สุด M ' Q ( I , ชุดเครื่องกำเนิดไฟฟ้าเครื่องปั่นไฟเล็กที่สุด เช่น อื่นๆ ทั้งหมด สร้างสมาชิกของ M ' ) สามารถมีได้หลายเครื่องน้อยที่สุดสำหรับการ ตัวอย่างเช่น ได้รับแบบสอบถามที่ถามสำหรับยอดขายรวมของเสื้อผ้าในรัฐวอชิงตัน ต่อไปนี้สองมุมมองที่เป็นทั้งเครื่องกำเนิดไฟฟ้า :( ขาย ) ทั้งหมด โดยแต่ละรัฐแต่ละผลิตภัณฑ์ ( B ) จากยอดขายทั้งหมด โดยแต่ละเมืองในแต่ละประเภท ความคิดของเครื่องกำเนิดไฟฟ้าที่น้อยที่สุดที่สามารถใช้โดยเครื่องมือค้นหาการเพิ่มประสิทธิภาพเพื่อ จำกัด การค้นหา materialized ดูเหมาะสมที่จะใช้ ในด้านเชิงพาณิชย์ , HP คลังสินค้าอัจฉริยะ หัวหอกใช้เครื่องปั่นไฟน้อยที่สุดเพื่อตอบแบบสอบถามในขณะที่เรากำหนดความคิดของเครื่องกำเนิดไฟฟ้าในจำกัดวิธี ปัญหาทั่วไปของการเพิ่มประสิทธิภาพแบบสอบถามในการแสดงตนของหลาย materialized views มีความซับซ้อนมากขึ้น ในพิเศษ กรณีเลือกโครงการเข้าร่วมแบบสอบถามมีการทำงานในพื้นที่นี้14 15 16 แปลง SQL ที่ซับซ้อนแบบสอบถามปัญหาของการค้นหาเทคนิคที่มีประสิทธิภาพสำหรับการประมวลผลที่ซับซ้อนแบบสอบถามได้มีความสนใจในการเพิ่มประสิทธิภาพ ในทาง , ระบบสนับสนุนการตัดสินใจให้สนามทดสอบสำหรับบางส่วนของความคิดที่ได้ศึกษามาก่อน เราจะสรุปบางส่วนของผลงานที่สำคัญมีงานมากมายใน " unnesting " SQL ที่ซับซ้อนแบบสอบถามที่มีอยู่ subqueries แปลไว้ในบล็อกเดียว แบบสอบถาม SQL เมื่อบางประโยค ข้อ จำกัด เป็น satisfied17 18 19 20 ทิศทางอื่นที่ได้รับในการติดตามที่ซ้อนกัน subqueries ลดจำนวนของอินโวเคชั่น batching และเรียกภายใน
การแปล กรุณารอสักครู่..
