Comparing the collection types

The following table compares the collection types based on the considerations.

Comparing factor

Nested table

Varray

Associative array

Maximum size

Unbound and grows dynamically.

Bounded. However, varray size, can only be increased thereafter.

Unbound and grows dynamically.

Sparsity

Starts dense but may become sparse due to deletions.

Always dense.

Can be sparse.

Storage considerations

Out-of-line storage in a separate storage table.

In-line storage up to 4000 bytes.

For out-of-line storage, the LOB clause must be specified.

Non-persistent collection uses program memory that is UGA.

Querying ability

A nested table type column can be queried as an instance. However, unnesting of an instance is possible ...

Get Advanced Oracle PL/SQL Developer's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.