Re: feeding big script to psql - Mailing list pgsql-general

From Tom Lane
Subject Re: feeding big script to psql
Date
Msg-id 25320.1123023817@sss.pgh.pa.us
Whole thread Raw
In response to Re: feeding big script to psql  (Havasvölgyi Ottó <h.otto@freemail.hu>)
List pgsql-general
=?iso-8859-2?Q?Havasv=F6lgyi_Ott=F3?= <h.otto@freemail.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

pgsql-general by date:

Previous
From: "Mohan, Ross"
Date:
Subject: Re: indexes are farked
Next
From: Richard Sydney-Smith
Date:
Subject: Windows file path for copy