Re: DBI/AutoCommit/Postgres

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: DBI/AutoCommit/Postgres
Дата
Msg-id 721.988672863@sss.pgh.pa.us
обсуждение исходный текст
Ответ на DBI/AutoCommit/Postgres  (Fran Fabrizio <ffabrizio@Exchange.WebMD.net>)
Список pgsql-general
Fran Fabrizio <ffabrizio@Exchange.WebMD.net> writes:
> Another crucial piece of information is that each insert kicks off a
> trigger.  I did not write the trigger, and do not know how to write
> triggers, but I think that might be the contributing factor to the
> slowness.

Bingo.  Your trigger is adding four complete queries (two selects and
two inserts or updates) for every row inserted.

Think about ways to avoid some or all of those.  (For example, does the
knownhosts table really need a last_contact column, or could you obtain
that on-the-fly from a query over the incoming or status table when
needed?)  Also look to see if these are being done with reasonable query
plans ... perhaps you need some indexes and/or vacuum operations ...

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Joel Burton
Дата:
Сообщение: Re: PHPPgAdmin or MS Access
Следующее
От: Eugene Lee
Дата:
Сообщение: TRUNCATE and INDEXes