Board index » delphi » Compact / Shrink Database (Interbase 6.01)

Compact / Shrink Database (Interbase 6.01)

Hi,

i have a database. i deleted some tables but database size is same. how can
i shrink database?

Thanks for answer.

 

Re:Compact / Shrink Database (Interbase 6.01)


In article <3c4d8c3b_2@dnews>, sallama_p...@yahoo.com says...

Quote

> i have a database. i deleted some tables but database size is same. how can
> i shrink database?

        Backup and restore the DB.  Note, however, that IB does not shrink
the DB for a *very good reason:*  Growing the DB file size takes time,
so IB doesn't release the space when you delete records.  This way, the
next time you create a record, IB will not have to grow the DB file, and
your performance will be better.

        HTH,

        -Craig

--
 Craig Stuntz (TeamB) Vertex Systems Corp. Columbus, OH
     Delphi/InterBase WebLog: http://delphi.weblogs.com
     InterBase PLANalyzer (Free IB optimization tool):
          http://delphi.weblogs.com/IBPLANalyzer

Re:Compact / Shrink Database (Interbase 6.01)


Not to mention, it's very difficult to "shrink" a file.  I think some people
think of a data file like a glass of water.

Quote
"Craig Stuntz" <cstuntz@no_spam.vertexsoftware.com> wrote in message

news:MPG.16b7653bea63a8fc989722@newsgroups.borland.com...
Quote
> In article <3c4d8c3b_2@dnews>, sallama_p...@yahoo.com says...

> > i have a database. i deleted some tables but database size is same. how
can
> > i shrink database?

> Backup and restore the DB.  Note, however, that IB does not shrink
> the DB for a *very good reason:*  Growing the DB file size takes time,
> so IB doesn't release the space when you delete records.  This way, the
> next time you create a record, IB will not have to grow the DB file, and
> your performance will be better.

> HTH,

> -Craig

> --
>  Craig Stuntz (TeamB) Vertex Systems Corp. Columbus, OH
>      Delphi/InterBase WebLog: http://delphi.weblogs.com
>      InterBase PLANalyzer (Free IB optimization tool):
>           http://delphi.weblogs.com/IBPLANalyzer

Re:Compact / Shrink Database (Interbase 6.01)


In article <3c4d9f91$1_1@dnews>, john_a_st...@mail.att.net says...

Quote
> Not to mention, it's very difficult to "shrink" a file.  I think some people
> think of a data file like a glass of water.

        IB purposely leaves blank spaces throughout the file to be filled
with record versions as you work with the DB.  This is considerably
faster than trying to keep the file as small as possible, because it
means that record versions will always be close to the original record.  
Shrinking the DB requires reading and writing the entire DB, which is
what a backup and restore does.  Try and ZIP an IB database sometime --
it's not uncommon to see it go to 1/10 of the size it started at.

        -Craig

--
 Craig Stuntz (TeamB) Vertex Systems Corp. Columbus, OH
     Delphi/InterBase WebLog: http://delphi.weblogs.com
     InterBase PLANalyzer (Free IB optimization tool):
          http://delphi.weblogs.com/IBPLANalyzer

Re:Compact / Shrink Database (Interbase 6.01)


Thanks for answers.

Other Threads