PolarDB for Oracle stores large objects as chunks in the database and uses a B-tree index to support efficient random access reads and writes.
How it works
Large objects are broken into chunks and stored as database rows. A B-tree index maps each chunk to its position within the large object, enabling fast lookups during random access reads and writes.
Chunks do not have to be contiguous. If you open a new large object, seek to offset 1000000, and write a few bytes there, the database allocates only the chunks covering the bytes you actually wrote — not 1,000,000 bytes of storage. Read operations return zeroes for any unallocated locations before the last existing chunk. This matches the sparse allocation behavior of Unix file systems.
Access control
Large objects have an owner and a set of access permissions managed with GRANT and REVOKE:
| Operation | Required privilege |
|---|---|
| Read a large object | SELECT |
| Write or truncate a large object | UPDATE |
| Delete, comment on, or change the owner | Large object owner or database superuser |
To adjust this behavior for compatibility with prior releases, use the lo_compat_privileges run-time parameter.