Re: DELETE queries slow down

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: DELETE queries slow down
Дата
Msg-id 873axdpp6v.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: DELETE queries slow down  ("Heikki Linnakangas" <heikki@enterprisedb.com>)
Ответы R: DELETE queries slow down  ("Galantucci Giovanni" <Giovanni.Galantucci@italtel.it>)
Список pgsql-performance
"Heikki Linnakangas" <heikki@enterprisedb.com> writes:

> Galantucci Giovanni wrote:
>
>> For 1 or 2 hours we update only one table, and everything goes ok, where
>> DELETE last at most 6 or 7 seconds.
>>
>> Then for a minute we do INSERT on both table, and everything continue
>> going ok, with DELETE that last about 10 seconds.
>>
>> From that moment on, DELETES become timeless, and last for 240 and more
>> seconds!

What do the inserts and deletes actually look like? Are there subqueries or
joins or are they just inserting values and deleting simple where clauses?

And are these in autocommit mode or are you running multiple commands in a
single transaction?

Generally it's faster to run more commands in a single transaction but what
I'm worried about is that you may have a transaction open which you aren't
committing for a long time. This can stop vacuum from being able to clean up
dead space and if it's in the middle of a query can actually cause vacuum to
get stuck waiting for the query to finish using the page it's using.

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com

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

Предыдущее
От: "Heikki Linnakangas"
Дата:
Сообщение: Re: DELETE queries slow down
Следующее
От: Ruben Rubio
Дата:
Сообщение: Re: [Again] Postgres performance problem