Re: Delete large amount of records and INSERT (with indexes) goes VERY slow

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: listuser(at)peternixon(dot)net, pgsql-general(at)postgresql(dot)org
Subject: Re: Delete large amount of records and INSERT (with indexes) goes VERY slow
Date: 2003-04-09 17:07:05
Message-ID: 20030409170705.GB3551@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Apr 09, 2003 at 12:59:01PM -0400, Tom Lane wrote:
> Peter Nixon <listuser(at)peternixon(dot)net> writes:
>
> > I then reran my import script and found that I was getting approximately 1
> > INSERT every 30 secconds!!! although SELECTS were working relatively
> > quickly.
>
> I think your mistake was to do VACUUM ANALYZE while the table was empty.
> That led the planner to generate plans suitable for a very small table
> --- seqscans instead of indexscans, for example.

But he _is_ getting good performance for SELECT, so the plans are not
that bad. Only insertion is slow. Can this be related to the btree
index bloating issue you fixed on january?

> A byproduct of rebuilding the index was to update the planner's idea
> of how big the table is, at which point the plans went back to normal.

But the index was recreated from scratch and thus free of any bloating.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Hay que recordar que la existencia en el cosmos, y particularmente la
elaboración de civilizaciones dentre de él no son, por desgracia,
nada idílicas" (Ijon Tichy)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message enediel 2003-04-09 17:09:09 multiple fields index
Previous Message Tom Lane 2003-04-09 16:59:01 Re: Delete large amount of records and INSERT (with indexes) goes VERY slow