Data Structures   «Prev  Next»
Lesson 7

Tuning with Oracle data structures Conclusion

This module explored the performance implications of the exciting new object-oriented features that were introduced in Oracle.
The main points of this module include:
  1. You can now define your own data types and define columns that participate in these data types.
  2. Some of the new object-oriented Oracle features include ADTs, OIDs, nested tables,
  3. Oracle now provides for nested tables, where a column can point to a number a row of a subordinate table.
  4. Oracle now has Object IDs (OIDs). These uniquely identify Oracle rows, and they will never change, even if the row is relocated.

Glossary Terms

Here are some terms that may be new to you:
  1. Object ID:A unique identifier for an object.
  2. Pointer: A variable or reference that holds address information and points or refers to a location (usually in another table).
  3. VARRAY:Is a repeating group that allows us to dramatically improve the performance of Oracle queries, because subordinate tables are no longer required in order to represent a one-to-many relationship.
The next module discusses using the Oracle Dictionary to monitor performance.

Object Tables and OIDs

In an object table, each row is a row object. An object table differs from a normal relational table in several ways.
  1. First, each row within the object table has an OID, an object identifier value assigned by Oracle when the row is created.
  2. Second, the rows of an object table can be referenced by other objects within the database.

You can create an object table via the create table command. Consider the ANIMAL_TY datatype shown in previous chapters. To avoid conflicts with objects created during earlier chapters, create this type in a new schema:
create or replace type ANIMAL_TY as object
(Breed VARCHAR2(25),
Name VARCHAR2(25),
BirthDate DATE);

To keep this example simple, the ANIMAL_TY datatype is created without any member functions. To create an object table of the ANIMAL_TY datatype, issue the following create table command:
create table ANIMAL of ANIMAL_TY;
Table created.

Note that the command has an unusual syntax, creating the table of an object type. The resulting table may first appear to be a normal relational table:
describe ANIMAL
Name 		        			Type
------------------------------- --------------------
BREED 					       VARCHAR2(25)
NAME 					       VARCHAR2(25)

The ANIMAL table's columns map to the attributes of the ANIMAL_TY object type. However, there are significant differences in how you can use the table, since it is an object table. As noted earlier in this section, each row within the object table will have an OID value, and the rows can be referenced as objects.

Object Data Constructs - Quiz

Before moving on to the next module, click the Quiz link below to test your understanding of tuning with data structures.
Object Data Constructs - Quiz