Re: --EXTERNAL--Re: [GENERAL] PSQL does not remove obvious useless joins

2016-07-05 Thread Sfiligoi, Igor
: Saturday, July 02, 2016 6:28 AM To: Sfiligoi, Igor Cc: pgsql-general@postgresql.org Subject: Re: --EXTERNAL--Re: [GENERAL] PSQL does not remove obvious useless joins On Fri, Jul 1, 2016 at 7:15 PM, Sfiligoi, Igor wrote: > OK. Will change our query generation code to not use the view. > (I have

Re: --EXTERNAL--Re: [GENERAL] PSQL does not remove obvious useless joins

2016-07-02 Thread Kevin Grittner
On Fri, Jul 1, 2016 at 7:15 PM, Sfiligoi, Igor wrote: > OK. Will change our query generation code to not use the view. > (I have tried the LEFT JOIN approach, but it just does not seem to perform.) > PS: Here are the numbers for the real production query (will not provide > details): > Original

Re: --EXTERNAL--Re: [GENERAL] PSQL does not remove obvious useless joins

2016-07-01 Thread Sfiligoi, Igor
-general@postgresql.org Subject: Re: --EXTERNAL--Re: [GENERAL] PSQL does not remove obvious useless joins On Fri, Jul 1, 2016 at 3:33 PM, Sfiligoi, Igor wrote: > No, I don't want to use LEFT JOINS. > I want to use regular joins. > > But (as mentioned in my other follow-up), all t

Re: --EXTERNAL--Re: [GENERAL] PSQL does not remove obvious useless joins

2016-07-01 Thread Kevin Grittner
On Fri, Jul 1, 2016 at 3:33 PM, Sfiligoi, Igor wrote: > No, I don't want to use LEFT JOINS. > I want to use regular joins. > > But (as mentioned in my other follow-up), all the fields are not > null (was not in the original email, sorry), and are foreign > keys, so it is guaranteed to always match

Re: --EXTERNAL--Re: [GENERAL] PSQL does not remove obvious useless joins

2016-07-01 Thread Sfiligoi, Igor
com] Sent: Friday, July 01, 2016 1:38 PM To: Sfiligoi, Igor ; Merlin Moncure Cc: pgsql-general@postgresql.org Subject: Re: --EXTERNAL--Re: [GENERAL] PSQL does not remove obvious useless joins On 07/01/2016 01:28 PM, Sfiligoi, Igor wrote: > Sorry... the example was incomplete. > > Al

Re: --EXTERNAL--Re: [GENERAL] PSQL does not remove obvious useless joins

2016-07-01 Thread Adrian Klaver
12:42 PM To: Sfiligoi, Igor Cc: pgsql-general@postgresql.org Subject: --EXTERNAL--Re: [GENERAL] PSQL does not remove obvious useless joins On Fri, Jul 1, 2016 at 12:17 PM, Sfiligoi, Igor wrote: Hello. We have a view that is very generic, and we noticed that PostgreSQL is not very good at rem

Re: --EXTERNAL--Re: [GENERAL] PSQL does not remove obvious useless joins

2016-07-01 Thread Sfiligoi, Igor
r Cc: pgsql-general@postgresql.org Subject: --EXTERNAL--Re: [GENERAL] PSQL does not remove obvious useless joins On Fri, Jul 1, 2016 at 12:17 PM, Sfiligoi, Igor wrote: > We have a view that is very generic, and we noticed that PostgreSQL is > not very good at removing useless joins, whic

Re: [GENERAL] PSQL does not remove obvious useless joins

2016-07-01 Thread Kevin Grittner
On Fri, Jul 1, 2016 at 12:17 PM, Sfiligoi, Igor wrote: > We have a view that is very generic, and we noticed that PostgreSQL is not > very good at removing useless joins, which makes our queries very slow. > > We could change our code to avoid the view and write ad-hoc queries to the > underlying

Re: --EXTERNAL--Re: [GENERAL] PSQL does not remove obvious useless joins

2016-07-01 Thread Sfiligoi, Igor
I was hoping this use case would fit in. Any suggestions? Igor -Original Message- From: Merlin Moncure [mailto:mmonc...@gmail.com] Sent: Friday, July 01, 2016 12:42 PM To: Sfiligoi, Igor Cc: pgsql-general@postgresql.org Subject: --EXTERNAL--Re: [GENERAL] PSQL does not remove obvious useless

Re: [GENERAL] PSQL does not remove obvious useless joins

2016-07-01 Thread Merlin Moncure
On Fri, Jul 1, 2016 at 12:17 PM, Sfiligoi, Igor wrote: > Hello. > > We have a view that is very generic, and we noticed that PostgreSQL is not > very good at removing useless joins, which makes our queries very slow. > > We could change our code to avoid the view and write ad-hoc queries to the >

[GENERAL] PSQL does not remove obvious useless joins

2016-07-01 Thread Sfiligoi, Igor
Hello. We have a view that is very generic, and we noticed that PostgreSQL is not very good at removing useless joins, which makes our queries very slow. We could change our code to avoid the view and write ad-hoc queries to the underlying tables, but would prefer not to, if there is a way aroun