Search Postgresql Archives

Re: COPY speedup

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

 



Il Thursday 13 December 2007 19:56:02 Tom Lane ha scritto:
> Reg Me Please <regmeplease@xxxxxxxxx> writes:
> > In order to speed up the COPY ... FROM ... command, I've
> > disabled everything (primary key, not null, references, default and
> > indexes) in the table definition before doing the actual COPY.
> > Later I can restore them with ALTER TABLE ... and CREATE INDEX ...
> >
> > My question is: is all this necessary, or could I save some of them
> > (maybe just the DEFAULT) with no speed cost?
>
> Indexes and foreign key references are the only things that benefit
> from this treatment.  DEFAULTs are irrelevant to a COPY, and simple
> constraints (NOT NULL and CHECK) are not any faster to verify later
> --- which makes dropping them slower, since you'll need an additional
> table scan to verify them when they're re-added.
>
> 			regards, tom lane

I'd suppose that foreign keys are to be "disabled" in order to speed things
up. Right?

-- 
Reg me, please!

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[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