Re: about compression
Posted in 1999
You are right about that. I have thought about doing that but decided
against that due to two reasons.
1. I have to use additional time when I look up the information. 2. most of my
records, even when I have it, don't fill up all 300 chars, say average 100,
therefore I'd still waste a good percentage of the space.
However, you are still right though, under the right circumstances it'd be
a viable solution.
thanks a lot.
yan
Vic Glass wrote:
> I realize that you're question is about data compression, but an alternate
> solution to using VARCHAR instead of CHAR is change the design of the table
> in question. For example:
>
> Before:
> create table emp
> (
> emp_id serial
> lname char(25),
> fname char(25),
> comment char(300),
> ...
> ...
> primary key (emp_id)
> )>
> After:
> create table emp
> (
> emp_id serial
> lname char(25),
> fname char(25),
> ...
> ...
> primary key (emp_id)
> )>
> create table emp_comment
> (
> emp_id integer,
> comment char(300),
> foreign key (emp_id) references emp
> )>
> In this case, data only *exists* when it is needed.
>
> Yan Zhu wrote:
>
> > hi all:
> > I have a field in a table which needs to be 300 long. However, only
> > 5% of all records (half a million of them) has this field filled with
> > actual text. My question is, does informix automatically compress the
> > empty space or do I have to do something to make it compress the wasted
> > space? I don't want to use 300 chars for each field while I don't use
> > most of them.
> >
> > thanks
> > yan