Recreating indexes and adding constraints
Presuming you dropped indexes and constraints before loading data in, you'll now need to recreate them again. Index rebuild in particular can be very processor, memory, and disk intensive. If you have a large disk array, it's quite reasonable to consider running two or more such rebuilds in parallel. It's recommended that you have high values for shared_buffers
, checkpoint_segments
, checkpoint_timeout
, and maintenance_work_mem
to make indexing and constraint checking perform well.