Re: How long should it take to insert 200,000 records?

От: Mark Lewis
Тема: Re: How long should it take to insert 200,000 records?
Дата: ,
Msg-id: 1170786686.16656.484.camel@archimedes
(см: обсуждение, исходный текст)
Ответ на: Re: How long should it take to insert 200,000 records?  ("Merlin Moncure")
Ответы: Re: How long should it take to insert 200,000 records?  (Bruno Wolff III)
Re: How long should it take to insert 200,000 records?  ("Merlin Moncure")
Список: pgsql-performance

Скрыть дерево обсуждения

How long should it take to insert 200,000 records?  ("Karen Hill", )
 Re: How long should it take to insert 200,000 records?  (Tom Lane, )
  Re: How long should it take to insert 200,000 records?  ("Karen Hill", )
   Re: How long should it take to insert 200,000 records?  (Mark Kirkwood, )
   Re: How long should it take to insert 200,000 records?  (Tom Lane, )
   Re: How long should it take to insert 200,000 records?  ("Lou O'Quin", )
  Re: How long should it take to insert 200,000 records?  ("Karen Hill", )
 Re: How long should it take to insert 200,000 records?  (Csaba Nagy, )
 Re: How long should it take to insert 200,000 records?  (Scott Marlowe, )
  Re: How long should it take to insert 200,000 records?  ("Merlin Moncure", )
   Re: How long should it take to insert 200,000 records?  (Scott Marlowe, )
    Re: How long should it take to insert 200,000 records?  ("Merlin Moncure", )
     Re: How long should it take to insert 200,000 records?  (Mark Lewis, )
      Re: How long should it take to insert 200,000 records?  (Bruno Wolff III, )
      Re: How long should it take to insert 200,000 records?  ("Merlin Moncure", )
       Re: How long should it take to insert 200,000 records?  (Mark Lewis, )

On Tue, 2007-02-06 at 12:01 -0500, Merlin Moncure wrote:
> On 2/6/07, Scott Marlowe <> wrote:
> > On Tue, 2007-02-06 at 10:40, Merlin Moncure wrote:
> > > On 2/6/07, Scott Marlowe <> wrote:
> > > > On Mon, 2007-02-05 at 18:35, Karen Hill wrote:
> > > > > I have a pl/pgsql function that is inserting 200,000 records for
> > > > > testing purposes.  What is the expected time frame for this operation
> > > > > on a pc with 1/2 a gig of ram and a 7200 RPM disk?   The processor is
> > > > > a 2ghz cpu.  So far I've been sitting here for about 2 million ms
> > > > > waiting for it to complete, and I'm not sure how many inserts postgres
> > > > > is doing per second.
> > > >
> > > > That really depends.  Doing 200,000 inserts as individual transactions
> > > > will be fairly slow.  Since PostgreSQL generally runs in autocommit
> > > > mode, this means that if you didn't expressly begin a transaction, you
> > > > are in fact inserting each row as a transaction.  i.e. this:
> > >
> > > I think OP is doing insertion inside a pl/pgsql loop...transaction is
> > > implied here.
> >
> > Yeah, I noticed that about 10 seconds after hitting send... :)
>
> actually, I get the stupid award also because RI check to unindexed
> column is not possible :)  (this haunts deletes, not inserts).

Sure it's possible:

CREATE TABLE parent (col1 int4);
-- insert many millions of rows into parent
CREATE TABLE child  (col1 int4 REFERENCES parent(col1));
-- insert many millions of rows into child, very very slowly.


- Mark Lewis




В списке pgsql-performance по дате сообщения:

От: Bill Howe
Дата:
Сообщение: Re: index scan through a subquery
От: "Hiltibidal, Robert"
Дата:
Сообщение: Re: explain analyze output for review (was: optimizing a geo_distance()...)