Re: proposal : cross-column stats

Поиск
Список
Период
Сортировка
От Tomas Vondra
Тема Re: proposal : cross-column stats
Дата
Msg-id 4D066BC4.2030801@fuzzy.cz
обсуждение исходный текст
Ответ на Re: proposal : cross-column stats  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Dne 13.12.2010 16:34, Tom Lane napsal(a):
> Tomas Vondra <tv@fuzzy.cz> writes:
>> Well, until this point we've discussed failure cases involving 'AND'
>> conditions. What about 'OR' conditions? I think the current optimizer
>> computes the selectivity as 's1+s2 - s1*s2' (at least that's what I
>> found in backend/optimizer/path/clausesel.c:630).
> 
> If you can solve the AND case, the OR case falls out of that.  Just
> replace s1*s2 with a more accurate AND calculation.

Oh yeah, now I see - it's just the usual equation
  P(A or B) = P(A) + P(B) - P(A and B)

and we're estimating "P(A and B)" as P(A)*P(B).

regards
Tomas


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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: ALTER TABLE ... ADD FOREIGN KEY ... NOT ENFORCED
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: proposal : cross-column stats