Re: strange behaviour with sub-select and pl/pgSQL

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: strange behaviour with sub-select and pl/pgSQL
Дата
Msg-id 20070301163043.GA1705@svana.org
обсуждение исходный текст
Ответ на strange behaviour with sub-select and pl/pgSQL  (Robert Partyka <rpartyka@wdg.pl>)
Список pgsql-general
On Tue, Feb 27, 2007 at 12:15:03PM +0100, Robert Partyka wrote:
> Hi,
>
> I found PostgreSQL have strange behaviour with sub-select and pl/pgSQL,
> see the case study at:
> http://www.bobson.pl/pgsql/pgsql_sb1.html

The PostgreSQL optimiser is pretty smart and will pull up simple
sub-selects like yours. If you put your subselect into a view, you'd
also want the optimiser to find the optimal plan, right?

If you want to stop it pulling up the subquery, you can add an  OFFSET
0 or ORDER BY or anything that makes it a not-simple subquery.  That
tells the planner to leave it alone.

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Вложения

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

Предыдущее
От: mobiledreamers@gmail.com
Дата:
Сообщение: Re: US Highschool database in postgres
Следующее
От: clark@knowideas.com
Дата:
Сообщение: How Can I set a non standard date format?