Re: Looking for tips
От
Oliver Crosby
Тема
Re: Looking for tips
Дата
Msg-id
1efd553a050719132836c31b78@mail.gmail.com
Ответ на
Re: Looking for tips (Dawid Kuroczko)
Список
Дерево обсуждения
Re: Looking for tips "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
> If it is possible try: > 1) wrapping many inserts into one transaction > (BEGIN;INSERT;INSERT;...INSERT;COMMIT;). As PostgreSQL will need to > handle less transactions per second (each your insert is a transaction), it > may work faster. Aye, that's what I have it doing right now. The transactions do save a HUGE chunk of time. (Cuts it down by about 40%). > 2) If you can do 1, you could go further and use a COPY command which is > the fastest way to bulk-load a database. I don't think I can use COPY in my case because I need to do processing on a per-line basis, and I need to check if the item I want to insert is already there, and if it is, I need to get it's ID so I can use that for further processing.
В списке pgsql-performance по дате отправления