Search Postgresql Archives

Re: general questions postgresql performance config

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

 



Andy Colson wrote:
I recall seeing someplace that you can avoid WAL if you start a transaction, then truncate the table, then start a COPY.

Is that correct?  Still hold true?  Would it make a lot of difference?

That is correct, still true, and can make a moderate amount of difference if the WAL is really your bottleneck. More of a tweak for loading small to medium size things as I see it. Once the database and possibly its indexes get large enough, the loading time starts being dominated by handling all that work, with its random I/O, rather than being limited by the sequential writes to the WAL. It's certainly a useful optimization to take advantage of when you can, given that it's as easy as:

BEGIN;
TRUNCATE TABLE x;
COPY x FROM ... ;
COMMIT;

--
Greg Smith    2ndQuadrant   Baltimore, MD
PostgreSQL Training, Services and Support
greg@xxxxxxxxxxxxxxx  www.2ndQuadrant.com


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

[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