Re: INSERT or COPY: Which one?
От | Bryan Irvine |
---|---|
Тема | Re: INSERT or COPY: Which one? |
Дата | |
Msg-id | 1086294229.12812.15.camel@elvis2.horvitznewspapers.net обсуждение исходный текст |
Ответ на | Re: INSERT or COPY: Which one? (Nabil Sayegh <postgresql@e-trolley.de>) |
Список | pgsql-novice |
I got this today and I don't know the if the list is behind or the senders client, so I'll reply anyway. I did some benchmark testing of copy vs insert, using a 3 million record file with 1 table and 3 fields containing 10 numbers (between all fields, they were phonenumbers to be precise). The insert took about 2 hours (this was last summer so my numbers might be slightly off) and the copy took 45 seconds. So use copy when appropriate. --Bryan On Tue, 2004-02-17 at 12:01, Nabil Sayegh wrote: > Colin Gillespie wrote: > > Dear All, > > > > I which to insert text (more than 1000 lines) into a single cell of my table, should I use COPY here or INSERT? > > > > My reading seems to suggest that you would use COPY for mulitple INSERTs, but when inserting alot of data into one cell,INSERT is fine. Is this correct? > > COPY is much faster, INSERT is safer. > I heard that all issues regarding COPY are fixed (since 7.3?), but IIRC I still had some trouble > with SERIALs and referential integrity. > > HTH
В списке pgsql-novice по дате отправления: