Re: Planner not using column limit specified for one column for another column equal to first

От: Tom Lane
Тема: Re: Planner not using column limit specified for one column for another column equal to first
Дата: ,
Msg-id: 8534.1271427587@sss.pgh.pa.us
(см: обсуждение, исходный текст)
Ответ на: Planner not using column limit specified for one column for another column equal to first  (Віталій Тимчишин)
Ответы: Re: Planner not using column limit specified for one column for another column equal to first  (Yeb Havinga)
Re: Planner not using column limit specified for one column for another column equal to first  (Віталій Тимчишин)
Список: pgsql-performance

Скрыть дерево обсуждения

Planner not using column limit specified for one column for another column equal to first  (Віталій Тимчишин, )
 Re: Planner not using column limit specified for one column for another column equal to first  (Yeb Havinga, )
  Re: Planner not using column limit specified for one column for another column equal to first  (Віталій Тимчишин, )
   Re: Planner not using column limit specified for one column for another column equal to first  (Yeb Havinga, )
    Re: Planner not using column limit specified for one column for another column equal to first  (Віталій Тимчишин, )
 Re: Planner not using column limit specified for one column for another column equal to first  (Віталій Тимчишин, )
 Re: Planner not using column limit specified for one column for another column equal to first  (Tom Lane, )
  Re: Planner not using column limit specified for one column for another column equal to first  (Yeb Havinga, )
   Re: Planner not using column limit specified for one column for another column equal to first  (Tom Lane, )
  Re: Planner not using column limit specified for one column for another column equal to first  (Віталій Тимчишин, )
   Re: Planner not using column limit specified for one column for another column equal to first  (Matthew Wakeling, )
 Re: Planner not using column limit specified for one column for another column equal to first  (Hannu Krosing, )

=?KOI8-U?B?96bUwcymyiD0yc3eydvJzg==?= <> writes:
> I've thought and someone in this list've told me that this should be done
> automatically.

No, that's not true.  We do make deductions about transitive equalities,
ie, given WHERE a=b AND b=c the planner will infer a=c and use that if
it's helpful.  We don't make deductions about inequalities such as a>c.
In theory there's enough information available to do so, but overall
trying to do that would probably waste more cycles than it would save.
You'd need a lot of expensive new planner infrastructure, and in the
vast majority of queries it wouldn't produce anything very helpful.

As was pointed out, even if we had such logic it wouldn't apply in this
example, because the equality conditions aren't real equalities but
OUTER JOIN conditions.

            regards, tom lane


В списке pgsql-performance по дате сообщения:

От: Josh Kupershmidt
Дата:
Сообщение: Re: stats collector suddenly causing lots of IO
От: Віталій Тимчишин
Дата:
Сообщение: Re: Planner not using column limit specified for one column for another column equal to first