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,

Re: Notifications within triggers seem to compromise performance

2019-10-28 Thread Grégoire de Turckheim
Le 28/10/2019 à 17:25, Tom Lane a écrit : =?UTF-8?Q?Gr=c3=a9goire_de_Turckheim?= writes: Le 28/10/2019 à 15:22, Tom Lane a écrit : We made some performance improvements for NOTIFY just a couple months ago, cf commits b10f40bf0, bb5ae8f6c, bca6e6435, 51004c717. It would be interesting to know

Re: Notifications within triggers seem to compromise performance

2019-10-28 Thread Tom Lane
=?UTF-8?Q?Gr=c3=a9goire_de_Turckheim?= writes: > Le 28/10/2019 à 15:22, Tom Lane a écrit : >> We made some performance improvements for NOTIFY just a couple months >> ago, cf commits b10f40bf0, bb5ae8f6c, bca6e6435, 51004c717. It would >> be interesting to know how much those changes helped your

Re: Notifications within triggers seem to compromise performance

2019-10-28 Thread Grégoire de Turckheim
Le 28/10/2019 à 15:22, Tom Lane a écrit : =?UTF-8?Q?Gr=c3=a9goire_de_Turckheim?= writes: I guess we stumbled upon a performance issue with notifications sent within triggers (using PostgreSQL version 11.5) and I'd like your opinion about this. We made some performance improvements for NOTIFY

Re: Notifications within triggers seem to compromise performance

2019-10-28 Thread Tom Lane
=?UTF-8?Q?Gr=c3=a9goire_de_Turckheim?= writes: > I guess we stumbled upon a performance issue with notifications sent within > triggers (using PostgreSQL version 11.5) > and I'd like your opinion about this. We made some performance improvements for NOTIFY just a couple months ago, cf commits b1

Notifications within triggers seem to compromise performance

2019-10-28 Thread Grégoire de Turckheim
Hi there! I guess we stumbled upon a performance issue with notifications sent within triggers (using PostgreSQL version 11.5) and I'd like your opinion about this. We want our app to maintain a data cache, so each instance of the app listens to some channels (one per table). There are update