Re: UNION causes horrible plan on JOIN

2019-10-28 Thread Kyotaro Horiguchi
At Mon, 28 Oct 2019 16:30:24 -0700, Craig James wrote in > On Mon, Oct 28, 2019 at 3:45 PM Justin Pryzby wrote: > > > On Mon, Oct 28, 2019 at 03:40:58PM -0700, Craig James wrote: > > > On Postgres 9.6 (config below), I have a case I don't understand: three > > > tables that can be separately q

Re: UNION causes horrible plan on JOIN

2019-10-28 Thread Craig James
On Mon, Oct 28, 2019 at 4:31 PM Justin Pryzby wrote: > On Mon, Oct 28, 2019 at 04:30:24PM -0700, Craig James wrote: > > On Mon, Oct 28, 2019 at 3:45 PM Justin Pryzby > wrote: > > > > > On Mon, Oct 28, 2019 at 03:40:58PM -0700, Craig James wrote: > > > > On Postgres 9.6 (config below), I have a c

Re: UNION causes horrible plan on JOIN

2019-10-28 Thread Craig James
On Mon, Oct 28, 2019 at 3:45 PM Justin Pryzby wrote: > On Mon, Oct 28, 2019 at 03:40:58PM -0700, Craig James wrote: > > On Postgres 9.6 (config below), I have a case I don't understand: three > > tables that can be separately queried in milliseconds, but when put > > together into one view using

Re: UNION causes horrible plan on JOIN

2019-10-28 Thread Justin Pryzby
On Mon, Oct 28, 2019 at 03:40:58PM -0700, Craig James wrote: > On Postgres 9.6 (config below), I have a case I don't understand: three > tables that can be separately queried in milliseconds, but when put > together into one view using UNION, take 150 seconds to query. Here's the > rough idea (actu

UNION causes horrible plan on JOIN

2019-10-28 Thread Craig James
On Postgres 9.6 (config below), I have a case I don't understand: three tables that can be separately queried in milliseconds, but when put together into one view using UNION, take 150 seconds to query. Here's the rough idea (actual details below): create view thesaurus as (select id,