Re: feeding big script to psql

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
Subject: Re: feeding big script to psql
Date: 2005-08-02 23:03:37
Message-ID: 25320.1123023817@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

=?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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Sydney-Smith 2005-08-03 02:24:43 Windows file path for copy
Previous Message Mohan, Ross 2005-08-02 22:30:30 Re: indexes are farked