Re: performance problems with subselects

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: performance problems with subselects
Дата
Msg-id 11581.1019570689@sss.pgh.pa.us
обсуждение исходный текст
Ответ на performance problems with subselects  (John Taylor <postgres@jtresponse.co.uk>)
Ответы Re: performance problems with subselects  (John Taylor <postgres@jtresponse.co.uk>)
Re: performance problems with subselects  (John Taylor <postgres@jtresponse.co.uk>)
Список pgsql-novice
John Taylor <postgres@jtresponse.co.uk> writes:
> I am aware that I am using almost the same select from orderheader 3
> times, but I'm not sure how I can improve on this.

Can you do this?

INSERT INTO target SELECT foo, bar, baz FROM source WHERE condition

To the extent that you are computing multiple fields from the same
row in the source table, this will help.

Also, avoid that IN construct.

            regards, tom lane

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

Предыдущее
От: John Taylor
Дата:
Сообщение: performance problems with subselects
Следующее
От: John Taylor
Дата:
Сообщение: Re: performance problems with subselects