Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Oracle Database does not support constraints on columns or attributes whose type is
a user-defined object, nested table, VARRAY, REF, or LOB
2. NOVALIDATE is the option used with check constraint which doesn't check for
previous inserted values in the table.
ALTER TABLE test2 ADD ( CONSTRAINT a CHECK ( a <= 5 ) NOVALIDATE );
3. Truncate vs Delete
DDL
- DML
Fast (data doesn't move into redo log buffer) - Slow (data
move to redo log buffer)
doesn't support where clause
- does support where clause
table level or page level lock
- row level lock
Lowers the table High Water Marks
- Doesn't
9. Aggreate function - many rows, collapse them into one. sum(), count(), max(),
min(), avg()
Analytical function - function is to analyze the data. They compute aggreate
values based on a group of rows. first_value. last_value
10. Hard parsing - Loading the data into shared pool
Soft parsing - Doesn't require loading of data into shared pool
12. Nested Loop and hash Loop are joining methods in oracle. If there are multiple
tables in the query, after the optimizer determines the access methods most
appropriate for each of the tables, the next step is to deterined the way tables
best be joined together and proper order in which to join them.
Nested Loops Join - as name implies a loop inside a loop. The outer most table is
the driving table which passes rows to inner table based on -1. the join conditions
provided in the query and
-2. the rows confirms to match with the inner query.
These kind of join are robust and acquires very less memory.
The primary measurement for nested loops is the no of blocks accesses required.
helpful -
Hash Joins - Based on table and index statistics, the table that is determined to
return the fewest rows will be hashed in the entirety memory.
Other larger table is read and hash function is applied to the join key column.That
hash value is then used to probe the smaller in memory hash table for the matching
hash bucket where the row data of the first table resides. if match is made the row
is returned else discarded.
helpful - Hash joins are considered more preferable when the row sources are larger
and the result set is larger as well
- if the smaller table can fit in memory, a hash join may be favoured
- Hash joins are only possible if the joins is an equi-join
Sort-merge Join - as the name suggest the table are first sorted individually and
then merged together.
helpful -
Sort-merge joins are typically best suited to queries that have limited data
filtering and return lots of rows.
They are also often a better choice if there are no suitable indexes that can be
used to access the data more directly.
A sort-merge join can be used to handle joins specified with an inequality
condition
Catesian Join - Joining every row of a table with every row of other table.
my_rec REC;