Re: insert/update tps slow with indices on table > 1M rows

От: Tom Lane
Тема: Re: insert/update tps slow with indices on table > 1M rows
Дата: ,
Msg-id: 6656.1212619939@sss.pgh.pa.us
(см: обсуждение, исходный текст)
Ответ на: Re: insert/update tps slow with indices on table > 1M rows  (andrew klassen)
Список: pgsql-performance

Скрыть дерево обсуждения

insert/update tps slow with indices on table > 1M rows  (andrew klassen, )
 Re: insert/update tps slow with indices on table > 1M rows  (PFC, )
 Re: insert/update tps slow with indices on table > 1M rows  (andrew klassen, )
 Re: insert/update tps slow with indices on table > 1M rows  ("Scott Marlowe", )
 Re: insert/update tps slow with indices on table > 1M rows  (Matthew Wakeling, )
  Re: insert/update tps slow with indices on table > 1M rows  (James Mansion, )
 Re: insert/update tps slow with indices on table > 1M rows  (andrew klassen, )
  Re: insert/update tps slow with indices on table > 1M rows  (Matthew Wakeling, )
 Re: insert/update tps slow with indices on table > 1M rows  (andrew klassen, )
  Re: insert/update tps slow with indices on table > 1M rows  (James Mansion, )
 Re: insert/update tps slow with indices on table > 1M rows  (andrew klassen, )
  Re: insert/update tps slow with indices on table > 1M rows  (PFC, )
  Re: insert/update tps slow with indices on table > 1M rows  (Tom Lane, )
  Re: insert/update tps slow with indices on table > 1M rows  ("Heikki Linnakangas", )

andrew klassen <> writes:
> I am using the c-library interface and for these particular transactions
> I preload PREPARE statements. Then as I get requests, I issue a BEGIN,
> followed by at most 300 EXECUTES and then a COMMIT. That is the
> general scenario. What value beyond 300 should I try?

Well, you could try numbers in the low thousands, but you'll probably
get only incremental improvement.

> Also, how might COPY (which involves file I/O) improve the
> above scenario?

COPY needn't involve file I/O.  If you are using libpq you can push
anything you want into PQputCopyData.  This would involve formatting
the data according to COPY's escaping rules, which are rather different
from straight SQL, but I doubt it'd be a huge amount of code.  Seems
worth trying.

            regards, tom lane


В списке pgsql-performance по дате сообщения:

От: Greg Smith
Дата:
Сообщение: Re: RAM / Disk ratio, any rule?
От: "Heikki Linnakangas"
Дата:
Сообщение: Re: insert/update tps slow with indices on table > 1M rows