Mon, Oct 25, 1999 ------------------------ - Overview of Database Tuning - Two Considerations (OLTP/OLAP) - Options: - Tune Schema - Multiple Choices of Normalized Schema - BCNF vs 3NF - Horizontal Partitioning - e.g. students with gpa <= 2.5 and > 2.5 - Use a VIEW to combine partitions - Vertical Partitioning - Store Aggregate Values - Differences among various aggregates for "maintainability" - SUM (easiest) - AVG (need O(1) storage) - MAX (extremely difficult) - Index Options - Primary vs. Secondary - Dense vs. Sparse - B-Trees vs. Hash-tables etc. - Attribute to place index on - when to use a secondary index? - Query Optimization, by Hand - Controlling the use of indices - rewrite a=6 as a+0=6 - rewrite a=b*2 as a/2 = b - table scans for small tables etc. - Try to replace subqueries by joins - not always possible - particularly when we have a DISTINCT in the sub-block without a DISTINCT at top - Try to replace multiple query "blocks" by one - Examples of Tuning Tools - AutoAdmin for Microsoft SQL Server - RDB Expert for ORACLE