Re: The optimizer is too smart for me - How can I trick it?

Поиск
Список
Период
Сортировка
От Adam Rich
Тема Re: The optimizer is too smart for me - How can I trick it?
Дата
Msg-id 026301c8c267$c3ecb870$4bc62950$@r@sbcglobal.net
обсуждение исходный текст
Ответ на The optimizer is too smart for me - How can I trick it?  ("Peter Vanderborght" <peter.vanderborght@taatu.com>)
Список pgsql-general
> I've implemented Depesz's running total function
> (http://www.depesz.com/index.php/2007/08/17/rownum-anyone-cumulative-
> sum-in-
> one-query/) in my DB, which works great.
> Now what I want to do is get the running total for a certain statement
> and
> then do a subselect on that result so to get a non-zero start on a
> function.
>
> Instead, the optimizer sees what I'm trying to do, moves the where
> clause
> inside the subquery and my output becomes
>
> What can I do to tell the optimizer to keep its hands off my query or
> at
> least get it to not optimize?
>

I think if you add a LIMIT/OFFSET clause to your subquery, the planner
will leave it alone.





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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Mediawiki 1.10 and PG 8.3 upgrade
Следующее
От: Gerhard Wiesinger
Дата:
Сообщение: Re: Tsearch2 Upgrade from 8.2 to 8.3.1 with mediawiki