Logical Schema and Query Tuning

Schema Tuning

It may be necessary to make changes to the conceptual database design and tune queries

Goals

  • Avoid expensive operations in query execution
    • Joins
  • Retrieving related data in fewer operations

Techniques

  • Choosing an alternative normalization or weaker normal form
  • Co-clustering relations and denormalization
  • Vertically and horizontally partitioning data and materialized views
  • Avoiding concurrency hot-spots

Tuning Conceptual Schema

Re-Normalization

Consider alternative BCNF decompositions that better fit the queries in the workload

Denormalization

Consider merging relational schemata to intentionally increase redundancy

Partitioning

Very large tables can be a source of performance bottlenecks

Splitting a table into multiple for the purpose of reducing I/O cost or lock contention

Horizontal Partitioning
Vertical Partitioning
Changes to the physical or conceptual schemas impacts all queries and updates in the workload

Tuning Queries

Sometimes desirable to target performance of specific queries or applications

Tuning Applications

Minimize communication costs

  1. Return the fewest columns and rows necessary
  2. Update multiple rows with a WHERE clause rather than a cursor

Minimize lock contention and hot-spots

  1. Delay updates as long as possible
  2. Delay operations on hot-spots as long as possible
  3. Shorten or split transactions as much as possible
  4. Perform insertions/updates/deletions in batches
  5. Consider lower isolation levels