Beruflich Dokumente
Kultur Dokumente
Object Description
You should create an index if: You should not create an index if:
• A column contains a wide • The table is small
range of values • The columns are not often
• A column contains a large used as a condition in the
query
number of null values
• Most queries are expected to
• One or more columns are retrieve more than 2–4% of the
frequently used together in rows in the table
a WHERE clause or a join • The table is updated frequently
condition
• The indexed columns are
• The table is large and most referenced as part of an
queries are expected to expression
retrieve less than 2–4% of
the rows
Index created.
SELECT *
FROM departments
WHERE UPPER(department_name) = 'SALES';
EMPVU80 View
Oracle server
iSQL*Plus
USER_VIEWS
SELECT * EMPVU80
FROM empvu80; SELECT employee_id,
last_name, salary
FROM employees
WHERE department_id=80;
EMPLOYEES
…
Syntax:
DROP VIEW view;
Example:
DROP VIEW empvu80;
View dropped.
• Similarities:
– Both consume storage space.
– Both must be refreshed when data in master table
changes.
– Both improve the performance of SQL execution.
– Both are transparent to SQL applications and
users.
• Differences:
– Materialized views can be accessed directly using a
SELECT statement
A sequence:
• Automatically generates unique numbers
• Is a sharable object
• Is typically used to create a primary-key value
• Replaces application code
• Speeds up the efficiency of accessing sequence
values when cached in memory
• Drop a synonym.
DROP SYNONYM d_sum;
Synonym dropped.