Search Postgresql Archives

feeding big script to psql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

A generated a big SQL script (about 20 Mb), and fed it to psql. I was very surprised that within a minute psql became quite slow. There were areas, where less than 10 row were inserted in a second. This is on a WinXP machine with local server 8.0.3, and only I use it. Looking at the log files of PG the commands are executed fast. I have monitored psql with te TaskManager, and it was at 45-50% CPU (this is Hyperthreaded, so 50% is the max for one thread), and the memory allocation/deallocation was very active, even about +-2Mb/sec. The command were simple create table and insert commands chunked into several lines like this:

CREATE TABLE aeloleg(
vevo CHAR(6),
szallito INTEGER,
datum DATE,
hatarido DATE,
vevo_nev CHAR(30),
ir_szam INTEGER,
helyseg CHAR(20),
cim CHAR(20),
befizetes INTEGER,
terheles INTEGER,
hitel INTEGER,
rendeles INTEGER,
jel CHAR(1),
trans INTEGER,
szoveg TEXT,
storno BOOLEAN) WITHOUT OIDS;

The insert commands for one table were surrounded by BEGIN and COMMIT like this:

CREATE
BEGIN
INSERT
INSERT
...
INSERT
COMMIT


I know it would be faster with COPY, but this is extremly slow, and the bottleneck is psql.
What is the problem?

Regards,
Otto



---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux