Re: Help with many updates

Поиск
Список
Период
Сортировка
Искать
От
Oliver Elphick
Тема
Re: Help with many updates
Дата
Msg-id
1014325782.3217.823.camel@linda
Ответ на
Help with many updates (Glenn MacGregor)
Список
Дерево обсуждения
Help with many updates "Glenn MacGregor" <gtm@oracom.com>
Re: Help with many updates Oliver Elphick <olly@lfix.co.uk>
On Thu, 2002-02-21 at 16:31, Glenn MacGregor wrote:
> What is the preferred way to do many updates.  Right now I am just doing
> each row at a time, is there a better way?  I have about 1000 or so and it
> takes a good 45 seconds

If you are currently doing:
  INSERT...  INSERT...

you can speed it up by enclosing the whole lot in a single transaction:
  BEGIN  INSERT...  INSERT...  COMMIT

You can get it even faster by formatting the input data in a text file
and using the COPY command (not in a transaction).

-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
    "My sheep hear my voice, and I know them, and they      follow me; And I give unto them eternal life; and they     shall never perish, neither shall any man pluck them      out of my hand."          John 10:27,28 


В списке pgsql-sql по дате отправления
От: Richard Emberson
Дата:
От: Jie Liang
Дата:
Сообщение: Re: all tables in a DB\?
FAQ