Re: DELETE with filter on ctid

Поиск
Список
Период
Сортировка
От Craig A. James
Тема Re: DELETE with filter on ctid
Дата
Msg-id 461AB6CF.3060202@modgraph-usa.com
обсуждение исходный текст
Ответ на DELETE with filter on ctid  ("Spiegelberg, Greg" <gspiegelberg@cranel.com>)
Ответы Re: DELETE with filter on ctid  ("Spiegelberg, Greg" <gspiegelberg@cranel.com>)
Список pgsql-performance
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.
Ihad a case where I created a "scratch" table like yours, and the before/after ANALYZE performance was the difference
between30 seconds and a few milliseconds for the same query. 

Craig

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: how to efficiently update tuple in many-to-many relationship?
Следующее
От: "s d"
Дата:
Сообщение: Re: Beginner Question