Re: [HACKERS] Improve OR conditions on joined columns (common starschema problem)

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: [HACKERS] Improve OR conditions on joined columns (common starschema problem)
Дата
Msg-id CAKJS1f9OPfZ4n9ozTeDMLpq6y10Ms3dVgQnepZ8xC0LyEcLNdQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Improve OR conditions on joined columns (common star schema problem)  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [HACKERS] Improve OR conditions on joined columns (common star schema problem)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 12 February 2017 at 13:30, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I wrote a POC patch for this on a long airplane ride.  It's not complete,
> and I'm sure there are bugs as well, but it makes your example case
> better.  What I did about the de-duplication issue is to de-dup using
> the CTIDs of all baserels in the query.  This means the optimization
> is only applicable to cases where all the rels have CTIDs ... but other
> methods such as inspecting unique keys ain't gonna work for non-table
> rels either, so I think this is about the best we can hope for.
> However, I did not understand your point about:

This is very interesting. Couldn't this be even more generic and
instead of looking at just the jointree quals, also look at the join
conditions too, as I think you can use this to also transforms queries
such as:

select * from t1 inner join t2 on t1.a = t2.a or t1.b = t2.b;

I imagine you'd also want an enable_unionor GUC which can be used to
disable this for when the planner makes a poor choice.

-- David Rowley                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



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

Предыдущее
От: Dean Rasheed
Дата:
Сообщение: Re: [HACKERS] multivariate statistics (v19)
Следующее
От: Magnus Hagander
Дата:
Сообщение: [HACKERS] RADIUS fallback servers