Re: feeding big script to psql

From: Havasvölgyi Ottó <h(dot)otto(at)freemail(dot)hu>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: feeding big script to psql
Date: 2005-08-03 21:54:41
Message-ID: 00ab01c59875$f42bbd70$8200a8c0@OTTO
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom,

My queries were written in multi-line mode like this:

insert into t1 values(1,
2,
3);

I don't know, what effect this has to performace..

Regards,
Otto

----- Original Message -----
From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Havasvölgyi Ottó" <h(dot)otto(at)freemail(dot)hu>
Cc: <pgsql-general(at)postgresql(dot)org>
Sent: Wednesday, August 03, 2005 1:03 AM
Subject: Re: [GENERAL] feeding big script to psql

> =?iso-8859-2?Q?Havasv=F6lgyi_Ott=F3?= <h(dot)otto(at)freemail(dot)hu> writes:
>> Thanks for the suggestion. I have just applied both switch , -f (I have
>> applied this in the previous case too) and -n, but it becomes slow again.
>> At
>> the beginning it reads about 300 KB a second, and when it has read 1.5
>> MB,
>> it reads only about 10 KB a second, it slows down gradually. Maybe others
>> should also try this scenario. Can I help anything?
>
> Well, I don't see it happening here. I made up a script consisting of a
> whole lot of repetitions of
>
> insert into t1 values(1,2,3);
>
> with one of these inserted every 1000 lines:
>
> \echo 1000 `date`
>
> so I could track the performance. I created a table by hand:
>
> create table t1(f1 int, f2 int, f3 int);
>
> and then started the script with
>
> psql -q -f big.sql testdb
>
> At the beginning I was seeing about two echoes per second. I let it run
> for an hour, and I was still seeing about two echoes per second. That's
> something close to 170MB of script file read (over 5.7 million rows
> inserted by the time I stopped it).
>
> So, either this test case is too simple to expose your problem, or
> there's something platform-specific going on. I don't have a windows
> machine to try it on ...
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-08-03 22:14:13 Re: oids and pg_class_oid_index constraint
Previous Message Thomas Chille 2005-08-03 21:33:21 initskript after db start; locks on transactions