Re: Query optimization problem

Поиск
Список
Период
Сортировка
От Dimitri Fontaine
Тема Re: Query optimization problem
Дата
Msg-id 871vanlu5g.fsf@hi-media-techno.com
обсуждение исходный текст
Ответ на Re: Query optimization problem  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
>  SELECT d1.ID, d2.ID
>  FROM DocPrimary d1
>    JOIN DocPrimary d2 ON d2.BasedOn=d1.ID
>  WHERE (d1.ID=234409763) or (d2.ID=234409763)
>
> ...you're going to scan d1, scan d2, and then join the results.  The
> scan of d1 is going to produce different results depending on whether
> you evaluate or not d1.ID=234409763, and the scan of d2 is going to
> produce different results depending on whether or not you evaluate
> d2.BasedOn=234409763.

Well I just realised you can't use d2.BasedOn in scanning d1 here. I
don't know what exactly I had in mind previously, but in any case, sorry
for the noise.

I hope the optimiser effort control still hold water nonetheless…
--
dim


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Query optimization problem
Следующее
От: Pavel Stehule
Дата:
Сообщение: patch saved in commitfest application isn't actual now