Re: Problems with estimating OR conditions, IS NULL on LEFT JOINs
От | Tom Lane |
---|---|
Тема | Re: Problems with estimating OR conditions, IS NULL on LEFT JOINs |
Дата | |
Msg-id | 104950.1687565314@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Problems with estimating OR conditions, IS NULL on LEFT JOINs (Tomas Vondra <tomas.vondra@enterprisedb.com>) |
Ответы |
Re: Problems with estimating OR conditions, IS NULL on LEFT JOINs
|
Список | pgsql-hackers |
Tomas Vondra <tomas.vondra@enterprisedb.com> writes: > The problem is that the selectivity for "IS NULL" is estimated using the > table-level statistics. But the LEFT JOIN entirely breaks the idea that > the null_frac has anything to do with NULLs in the join result. Right. > I wonder how to improve this, say by adjusting the IS NULL selectivity > when we know to operate on the outer side of the join. We're able to > do this for antijoins, so maybe we could do that here, somehow? This mess is part of the long-term plan around the work I've been doing on outer-join-aware Vars. We now have infrastructure that can let the estimator routines see "oh, this Var isn't directly from a scan of its table, it's been passed through a potentially-nulling outer join --- and I can see which one". I don't have more than vague ideas about what happens next, but that is clearly an essential step on the road to doing better. regards, tom lane
В списке pgsql-hackers по дате отправления: