Re: DELETE performance issues

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: DELETE performance issues
Дата
Msg-id 17384.1162484843@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: DELETE performance issues  ("Schwenker, Stephen" <SSchwenker@thestar.ca>)
Ответы Re: DELETE performance issues  (Reece Hart <reece@harts.net>)
Список pgsql-general
"Schwenker, Stephen" <SSchwenker@thestar.ca> writes:
> All the tables have primary keys and when I explain the queries, they
> use the primary key index.  I have increased the shared memory which
> only seems to help when the same table is accessed synchronously but
> this switching back and forth between tables seems to be slow.  There
> are approximately 600,000 rows in the tables.  And these tables do not
> have any references point to them but they do reference other tables.

Are you absolutely sure about that last?  Unindexed foreign key
references are the explanation nine times out of ten when someone
complains about deletes being slow.

> I'm guessing that the problem lies in loading the indexes off the disk
> each time the table switches.

For tables with only 600K rows the indexes should be plenty small enough
to fit in memory on any modern machine.  I'm thinking maybe the problem
is enormous index bloat ... does REINDEXing the tables improve matters?

> max_fsm_pages = 40000

That seems mighty small :-(.  Do a database-wide VACUUM VERBOSE and see
what it says about FSM usage in the last few lines of output.

            regards, tom lane

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: pg_dump question
Следующее
От: "Gurjeet Singh"
Дата:
Сообщение: Re: lots of values for IN() clause