-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

PostgreSQL 10 High Performance
By :

There are two slightly different types of bulk data loads you might want to do. The first type, and the main focus of this section, is when you're initially populating an empty database. Sometimes you also need to do later bulk loads into tables that are already populated. In that case, some of the techniques here, such as dropping indexes and constraints, will no longer be applicable. And you may not be able to get quite as aggressive in tuning the server for better loading speed when doing incremental loading. In particular, options that decrease the integrity of the whole server, such as disabling fsync
, only make sense when starting with a blank system.
The preferred path to get a lot of data into the database is by using the COPY
command. This is the fastest way to insert a set of rows. If that's not practical and you have to use INSERT
instead, you should try to include as many records as possible per commit, wrapping several into a BEGIN
/COMMIT
block. Most...