From: | "Albertson, Chris" <CAlbertson(at)primeadvantage(dot)com> |
---|---|
To: | "'Renaud Thonnart'" <thonnart(at)amwdb(dot)u-strasbg(dot)fr>, Einar Karttunen <ekarttun(at)cs(dot)Helsinki(dot)FI> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | RE: Time to insert |
Date: | 2001-05-03 15:57:57 |
Message-ID: | 71EFB3F67FADD3119C0A00508B5544419661F5@mailtest123.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
The fastest way to add many records is to drop the
indexes and then use copy., then rebuild the idexes.
Yes I know it's not pretty.
You can in fact use VACUUM from C/C++. Use fork/exec
to start a shell that runs vaccum. Takes abut six or
eight lines of code.
> -----Original Message-----
> From: Renaud Thonnart [mailto:thonnart(at)amwdb(dot)u-strasbg(dot)fr]
> Sent: Thursday, May 03, 2001 3:50 AM
> To: Einar Karttunen
> Cc: pgsql-general(at)postgresql(dot)org
> Subject: Re: [GENERAL] Time to insert
>
>
> It is a little difficult to perform VACUUM analyse because
> I'm writing an
> application in C++ using libpq++.
> I Use version 7.0.3
> I try COPY too but result was about the same.
>
> Renaud.
>
>
> Einar Karttunen wrote:
>
> > On Thu, 3 May 2001, Renaud Thonnart wrote:
> >
> > > Hi everyone
> > > Could someone explain me why time of insertion become
> that long when
> > > table increase ?
> > > For the same kind of insertion:
> > > When table is empty : 0.03s/row
> > > Table has 3663 rows : 2.07s/row
> > > Is that normal ?
> > >
> > > Sincerely, Renaud THONNART
> > >
> > Have you performed a VACUUM [ANALYZE]? If you are inserting
> data in larger
> > patches consider using copy or dropping indexes. What
> version of pgsql are
> > you using? There used to be (if I remember correctly) a bug
> in 7.1 betas
> > that made the inserts slow down.
> >
> > - Einar Karttunen
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>
From | Date | Subject | |
---|---|---|---|
Next Message | Trond Eivind =?iso-8859-1?q?Glomsr=F8d?= | 2001-05-03 15:58:20 | Re: Ideal hardware configuration for pgsql |
Previous Message | Peter Eisentraut | 2001-05-03 15:53:35 | Re: BLOB type |