Re: Why all the max length constraints?

From: Tony D <tonyisyourpal_at_netscape.net>
Date: 29 May 2006 09:29:23 -0700
Message-ID: <1148920163.564432.231940_at_i39g2000cwa.googlegroups.com>


Basically, there is a very direct mapping between what you put in the "create table" command and the collection of bytes that appear on a disk drive. If you were to have a table like this

create table mytable(
c1 integer,
c2 char(5)
);

On disk you would very probably have a series of about 11 bytes (4 bytes for the integer + 1 to indicate whether it is null or not, plus 5 bytes for the characters + 1 to indicate if it is null or not), plus probably 4 (or more) bytes as an internal row or tuple identifier. (The DBMS may additional management info as well.) For quite a few DBMS products, you could, if sufficiently willing, sit with an octal dump and reverse engineer the database schema from the byte sequences very straightforwardly - the enemy would be time and effort, rather than difficulty.

This is probably the most simple and straightforward way of putting this info on disk, but not necessarily the most efficient for all operations. But hey, you can index it, right ? :)

I don't know the Firebird/Interbase systems, so I can't comment on those.

  • Tony
Received on Mon May 29 2006 - 18:29:23 CEST

Original text of this message