Re: DELETE with filter on ctid

Список
Период
Сортировка
От Spiegelberg, Greg
Тема Re: DELETE with filter on ctid
Дата
Msg-id 82E74D266CB9B44390D3CCE44A781ED90B6ADE@POSTOFFICE.cranel.local
обсуждение исходный текст
Ответ на Re: DELETE with filter on ctid  ("Craig A. James")
Список pgsql-performance
Дерево обсуждения
DELETE with filter on ctid  ("Spiegelberg, Greg", )
 Re: DELETE with filter on ctid  (Tom Lane, )
  Re: DELETE with filter on ctid  ("Spiegelberg, Greg", )
   Re: DELETE with filter on ctid  (Tom Lane, )
 Re: DELETE with filter on ctid  ("Craig A. James", )
  Re: DELETE with filter on ctid  ("Spiegelberg, Greg", )
Craig,

I'm not using a TEMP TABLE in this DELETE however I have tried an
ANALYZE prior to the DELETE but it hardly makes a dent in the time.

Please look at the other follow-up email I just sent for full details.

Greg


-----Original Message-----
From: Craig A. James [mailto:]
Sent: Monday, April 09, 2007 5:58 PM
To: Spiegelberg, Greg
Cc: 
Subject: Re: [PERFORM] DELETE with filter on ctid

Spiegelberg, Greg wrote:
> We have a query which generates a small set of rows (~1,000) which are

> to be used in a DELETE on the same table.  The problem we have is that

> we need to join on 5 different columns and it takes far too long.

You may have encountered the same problem I did:  You *must* run ANALYZE
on a temporary table before you use in another query.  It's surprising
that this is true even for very small tables (a few hundred to a few
thousand rows), but it is.  I had a case where I created a "scratch"
table like yours, and the before/after ANALYZE performance was the
difference between 30 seconds and a few milliseconds for the same query.

Craig

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: join to view over custom aggregate seems like it should be faster
Следующее
От: "Michael Dengler"
Дата:
Сообщение: Do I need to rebuild php-pgsql for 8.2.3