Re: how to speed up query
От | Erwin Brandstetter |
---|---|
Тема | Re: how to speed up query |
Дата | |
Msg-id | 1181596607.159164.9790@w5g2000hsg.googlegroups.com обсуждение исходный текст |
Ответ на | how to speed up query ("Andrus" <kobruleht2@hot.ee>) |
Ответы |
Re: how to speed up query
|
Список | pgsql-general |
On Jun 11, 2:23 pm, "Andrus" <kobrule...@hot.ee> wrote: > I tried > > CREATE TEMP TABLE mydel AS > SELECT r.dokumnr > FROM rid r > LEFT JOIN dok d USING (dokumnr) > WHERE d.dokumnr IS NULL; > DELETE FROM rid USING mydel WHERE rid.dokumnr =mydel.dokumnr; > drop table mydel; > > and this runs 1 seconds intead for 2.2 hours. > > Thank you very much. > This works! > > It's sad that PostgreSQL cannot optimize this delete statement > automatically. 1 second does sound a lot better than 2 hours, doesn't it? :) As to why Postgres seems to fail, I cannot say any more, as your description is unclear. I am pretty sure there is some misunderstanding, though. Regards Erwin
В списке pgsql-general по дате отправления: