Alex wrote:
> Hi,
> I use pg_restore to load a previously dumped database. (10mil records).
> the load of the data runs quite fast but when starting creating the
> triggers for foreign keys it takes forever.
>
> Isnt there are a faster way. after all the triggers in the source db
> already made sure the data was clean.
You can try creating index/triggers first and load the data. At the end it will
take a while before you get a usable database with either approach but see what
works faster for you.
Personally I was in a situation where postgresql was hogging space while
creating index on a table that had 81M rows with 3GB disk footprint. I dropped
the table and recreated it. Also created index before loading data. The loading
was slow with this approach but it finished in 3 hours. And I had an updated
index as well. Just had to run vacuum over it.
Take your pick..
Shridhar