Re: planner missing a trick for foreign tables w/OR conditions
От | Tom Lane |
---|---|
Тема | Re: planner missing a trick for foreign tables w/OR conditions |
Дата | |
Msg-id | 18548.1387238352@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: planner missing a trick for foreign tables w/OR conditions (Robert Haas <robertmhaas@gmail.com>) |
Ответы |
Re: planner missing a trick for foreign tables w/OR conditions
|
Список | pgsql-hackers |
Robert Haas <robertmhaas@gmail.com> writes: > On Mon, Dec 16, 2013 at 2:04 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote: >> The problem is that that optimization is a crock; see the comments >> for create_or_index_quals(). We can't just turn it loose to CNF-ify >> every OR it might find. The case that we support at the moment is >> to CNF-ify whichever single OR condition looks like the best win, >> and it's hard to see how to do that without any index knowledge. > Could we get by without actually converting to CNF? The hard part is not extracting the partial qual. The hard part is trying to make sure that adding this entirely-redundant scan qual doesn't catastrophically degrade join size estimates. The hack of making an inverse adjustment to the original OR clause's selectivity works, more or less, for a single join OR condition. I don't think it works if there's several modified OR conditions (possibly covering different sets of relations). regards, tom lane
В списке pgsql-hackers по дате отправления: