Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > COPY Performanc...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 9 Topic 15455 of 15987
Post > Topic >>

COPY Performance

by lists@[EMAIL PROTECTED] ("Hans Zaunere") May 4, 2008 at 07:11 PM

Hello,

We're using a statement like this to dump between 500K and >5 million
rows.

COPY(SELECT SomeID FROM SomeTable WHERE SomeColumn > '0')
  TO '/dev/shm/SomeFile.csv'

Upon first run, this operation can take several minutes.  Upon second run,
it will be complete in generally well under a minute.

Some observations/thoughts:

-- When watching the file grow, it will "trickle" upon first run,
increasing
in size by only a few kb/s.  Upon second run, it will grow by megabytes
per
second.

-- If we dump to disk, the same behavior is observed - no apparent RAM
contention issues.

-- The SELECT by itself will complete typically in a few seconds, either
on
second or first run.

-- Upon the first run, the PostgreSQL process typically consumes <10% CPU.

-- In very rare cases, we've seen even the first run be as fast as the
second run.

-- There is no other activity on the server while performing these tests.

-- SomeID is just an int

-- CPU usage (wait %) is low; seems as though there is some other
bottleneck


Any thoughts on:

-- tuning parameters to speed up the initial execution

-- why is it so slow to begin with?

-- possible areas to check for bottlenecks?

-- better method for accompli****ng the same thing?


Thank you,

H




-- 
Sent via pgsql-general mailing list (pgsql-general@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
 




 9 Posts in Topic:
COPY Performance
lists@[EMAIL PROTECTED]   2008-05-04 19:11:35 
Re: COPY Performance
tgl@[EMAIL PROTECTED] (T  2008-05-04 19:41:01 
Re: COPY Performance
lists@[EMAIL PROTECTED]   2008-05-05 08:18:07 
Re: COPY Performance
scott.marlowe@[EMAIL PROT  2008-05-04 18:11:15 
Re: COPY Performance
lists@[EMAIL PROTECTED]   2008-05-05 08:11:44 
Re: COPY Performance
scott.marlowe@[EMAIL PROT  2008-05-05 09:01:21 
Re: COPY Performance
lists@[EMAIL PROTECTED]   2008-05-05 16:14:08 
Re: COPY Performance
scott.marlowe@[EMAIL PROT  2008-05-05 09:03:15 
Re: COPY Performance
scott.marlowe@[EMAIL PROT  2008-05-05 09:08:05 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Sun Jul 6 18:41:26 CDT 2008.