Обсуждение: table very big !!!!!

Поиск
Список
Период
Сортировка

table very big !!!!!

От
Pablo Salazar Loaiza
Дата:
Hello all

I have a DB in Postgres, and i have one application that work with this
DB, and exist one table where dialy is writing register in this table,
but to midnigth , i do delete from table.

But the size always is growing.

Thanks in advance



Re: [INTERFACES] table very big !!!!!

От
Hannu Krosing
Дата:
Pablo Salazar Loaiza wrote:
> 
> Hello all
> 
> I have a DB in Postgres, and i have one application that work with this
> DB, and exist one table where dialy is writing register in this table,
> but to midnigth , i do delete from table.
> 
> But the size always is growing.
>

You should run the database command 

>analyze;

that will get rid of old tuples that are no longer used

--------------
Hannu


Re: [INTERFACES] table very big !!!!!

От
Peter Mount
Дата:
On Mon, 22 Nov 1999, Pablo Salazar Loaiza wrote:

> Hello all
> 
> I have a DB in Postgres, and i have one application that work with this
> DB, and exist one table where dialy is writing register in this table,
> but to midnigth , i do delete from table.
> 
> But the size always is growing.

Are you running a vacuum after the delete?

Peter

--      Peter T Mount peter@retep.org.uk     Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgresJava PDF Generator: http://www.retep.org.uk/pdf



Re: [INTERFACES] table very big !!!!!

От
Pablo Saul Salazar - CESERCOMP
Дата:
Yes, i have a C program that first do delete and after run command vacuum
analyze, but this command dont do nothing, because the size the table
grow

another solutions!!! ???

Thanks


Pablo Salazar LoaizaAsistente de Redes CESERCOMP-ESPOL


On Mon, 22 Nov 1999, Peter Mount wrote:

> On Mon, 22 Nov 1999, Pablo Salazar Loaiza wrote:
> 
> > Hello all
> > 
> > I have a DB in Postgres, and i have one application that work with this
> > DB, and exist one table where dialy is writing register in this table,
> > but to midnigth , i do delete from table.
> > 
> > But the size always is growing.
> 
> Are you running a vacuum after the delete?
> 
> Peter
> 
> --
>        Peter T Mount peter@retep.org.uk
>       Main Homepage: http://www.retep.org.uk
> PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres
>  Java PDF Generator: http://www.retep.org.uk/pdf
> 
> 



Re: [INTERFACES] table very big !!!!!

От
Peter Mount
Дата:
On Mon, 22 Nov 1999, Pablo Saul Salazar - CESERCOMP wrote:

> Yes, i have a C program that first do delete and after run command vacuum
> analyze, but this command dont do nothing, because the size the table
> grow

Ah, try running first vacuum; then vacuum analyze. The first one will
truncate the table removing the wasted space. The second simply rebuilds
some statistics about the table.

Peter

> 
> another solutions!!! ???
> 
> Thanks
> 
> 
> Pablo Salazar Loaiza
>  Asistente de Redes
>   CESERCOMP-ESPOL
> 
> 
> On Mon, 22 Nov 1999, Peter Mount wrote:
> 
> > On Mon, 22 Nov 1999, Pablo Salazar Loaiza wrote:
> > 
> > > Hello all
> > > 
> > > I have a DB in Postgres, and i have one application that work with this
> > > DB, and exist one table where dialy is writing register in this table,
> > > but to midnigth , i do delete from table.
> > > 
> > > But the size always is growing.
> > 
> > Are you running a vacuum after the delete?
> > 
> > Peter
> > 
> > --
> >        Peter T Mount peter@retep.org.uk
> >       Main Homepage: http://www.retep.org.uk
> > PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres
> >  Java PDF Generator: http://www.retep.org.uk/pdf
> > 
> > 
> 

--      Peter T Mount peter@retep.org.uk     Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgresJava PDF Generator: http://www.retep.org.uk/pdf



Re: [INTERFACES] table very big !!!!!

От
Tom Lane
Дата:
Peter Mount <peter@retep.org.uk> writes:
> Ah, try running first vacuum; then vacuum analyze. The first one will
> truncate the table removing the wasted space. The second simply rebuilds
> some statistics about the table.

This is not right --- AFAICT, vacuum *always* runs the compaction phase.
You can allow or skip the stats-gathering phase by specifying "analyze"
or not, but "vacuum analyze" implies "vacuum".

It sounds like Pablo has a problem with vacuum not doing what it is
supposed to ... has anyone else ever seen that?  It's a new one on me.
        regards, tom lane


Re: [INTERFACES] table very big !!!!!

От
Hiroshi Inoue
Дата:
Pablo Saul Salazar - CESERCOMP wrote:
> 
> Yes, i have a C program that first do delete and after run command vacuum
> analyze, but this command dont do nothing, because the size the table
> grow
> 
> another solutions!!! ???
>

Are there any pending transactions ?
If a very old transaction is alive,vacuum never
remove deleted tuples. 

Regards.

Hiroshi Inoue
Inoue@tpf.co.jp


Re: [INTERFACES] table very big !!!!!

От
Peter Mount
Дата:
On Mon, 22 Nov 1999, Tom Lane wrote:

> Peter Mount <peter@retep.org.uk> writes:
> > Ah, try running first vacuum; then vacuum analyze. The first one will
> > truncate the table removing the wasted space. The second simply rebuilds
> > some statistics about the table.
> 
> This is not right --- AFAICT, vacuum *always* runs the compaction phase.
> You can allow or skip the stats-gathering phase by specifying "analyze"
> or not, but "vacuum analyze" implies "vacuum".

Thanks for the correction. I've always run both myself, hence the answer.

Peter

--      Peter T Mount peter@retep.org.uk     Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgresJava PDF Generator: http://www.retep.org.uk/pdf