Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Does having primary key at the end of table take up space

Re: Does having primary key at the end of table take up space

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: 2000/03/10
Message-ID: <952733093.3367.1.nnrp-09.9e984b29@news.demon.co.uk>#1/1

In principle it matters.

In practice you are only losing two bytes per row when you have two blank columns at the start of the table, as Oracle will be using two bytes (one per column) to record the fact that the column is empty. These
bytes are not needed for empty columns
at the end of the row because there is
a 'used column count' at the start of the row.

--

Jonathan Lewis
Yet another Oracle-related web site:  http://www.jlcomp.demon.co.uk

tim.mcconechy_at_runtime.dk wrote in message <8aatqb$cu0$1_at_nnrp1.deja.com>...

>HI!
>
>I was wondering about a comment a colleque made and if it is correct or
>not. Does having a PK at the end of the table take up unneccessary space
>when they are left as null?
>
>Say I have a Table like:
>CHK10MEMO VARCHAR2(4000)
>CHK20MEMO VARCHAR2(4000)
>RECNO NOT NULL NUMBER(20)
>USER_NAME VARCHAR2(15)
>LASTEDIT DATE
>
>And the columns Chk10memo and chk20memo
>contain no data.
>
>Because the recno field is required and filled in does this mean we are
>taking up space up to this point on the other columns?
>
>Would it be better to do:
>
>RECNO NOT NULL NUMBER(20)
>USER_NAME VARCHAR2(15)
>LASTEDIT DATE
>CHK10MEMO VARCHAR2(4000)
>CHK20MEMO VARCHAR2(4000)
>
>I tried to varify this claim on 8.0.5 and it seemed to not be a problem.
>
>
>Thanks a lot
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.
Received on Fri Mar 10 2000 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US