Re: Delete large amount of records and INSERT (with indexes) goes VERY slow - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Delete large amount of records and INSERT (with indexes) goes VERY slow
Date
Msg-id 20030409170705.GB3551@dcc.uchile.cl
Whole thread Raw
In response to Re: Delete large amount of records and INSERT (with indexes) goes VERY slow  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Delete large amount of records and INSERT (with indexes) goes VERY slow  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Delete large amount of records and INSERT (with indexes)  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-general
On Wed, Apr 09, 2003 at 12:59:01PM -0400, Tom Lane wrote:
> Peter Nixon <listuser@peternixon.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)


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Delete large amount of records and INSERT (with indexes) goes VERY slow
Next
From: Tom Lane
Date:
Subject: Re: Delete large amount of records and INSERT (with indexes) goes VERY slow