![]() |
Session
Seven
Additional Considerations |
![]() |
Indexes:
A concatenated index is an index created
on a group of columns in a single table.
Map a composite key to a concatenated index.
Use indexes to implement keys and to support
application access requirements.
Consider indexing
Indexes add storage and update overhead.
Predefined windows into the database.
Establish database views to meet application access requirements .![]()
Views can be used for:
Views can:
- restricting access.
- providing referential integrity.
- presenting tables to users in any form.
- pre-packaging complex queries.
- producing rapid prototypes.
- pre-joined base tables in SQL*Forms.
- checking data input.
Use views with caution.
- Restrict what the user, designer, or tool sees.
- Present normalized data in a denormalized form.
Access through a view is slower
View may cause query optimization to be slower.
Start in 3 NFBeware of Denormalization! Be VERY reluctant to denormalize.
Denormalization can cause data inconsistency problems.
Denormalization may be needed for transactions with performance requirements such as:
Consider all other options prior to denormalization, especially adding or changing the index structure.
- high throughput.
- high frequency.
- quick response time.
Combining tables is the most common form of denormalization.
Individual codes tables may be combined into a reference table.
- This will allow for validating and decoding coded values for an entire application system.
- Establish a companion CODE_TYPE table for validating code description lengths.
A vector is: Represent vector data as either a set of rows or a set of columns.
- A one-dimensional array with a fixed number of values
- A repeating group of definite size.
Choose the design based upon the functional access requirements.
Column-Wise Table Design
![]()
Row-Wise Table Design
- SQL group functions act on columns, e.g., SUM, AVG.
- Changes in the vector length can be easily accommodated.
- On the input form, all data values can appear on a single line.
- All values can be inserted with a single INSERT statement.
- The storage space requirement is lower.
Output reports showing all values horizontally are easy to produce.
![]()
Reconsider storing derived data in light of the functional access requirements and the capabilities of the software development tools.
Work with the Database Administrator to plan the physical placement of the database tables and indexes.
SQL> CREATE TABLE DEPARTMENT