Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Order of fields in a table.
> If you use LONG datatypes, they should sensibly be the last columns in the
> table, because access to them is sequential and they are always stored
> in-line with your other data (meaning getting at that other data would
> require you to wade through the entire LONG if it was stored in a column
> positioned before it).
Actually LONGs are *always* stored as last columns in row, no matter what you specify in create table statement. This is an Oracle internal optimization.
SQL> create table l (a number, b long, c number);
Table created.
SQL> select obj# from obj$ where name = 'L';
OBJ#
30120
SQL> select name, col#, segcol# from col$ where obj# = 30120;
NAME COL# SEGCOL# ------------------------------ ---------- ---------- A 1 1 B 2 3 C 3 2
SEGCOL# shows the physical column ordering, COL# shows ordering what we see using describe command.
Tanel. Received on Sat Jul 05 2003 - 10:15:26 CDT