Re: Poor plan when using EXISTS in the expression list

From: Geoff Winkless <pgsqladmin(at)geoff(dot)dj>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Poor plan when using EXISTS in the expression list
Date: 2018-10-04 14:46:26
Message-ID: CAEzk6fdLWr+RGQN0D+L50oeTj8hvM4s3HJ1Q4StGYHCQXXUeUg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 4 Oct 2018 at 13:11, Pierre Ducroquet <p(dot)psql(at)pinaraf(dot)info> wrote:

> Our developpers ORM (Django's) sadly can not use EXISTS in the where
> clauses
> without having it in the expression part of the SELECT statement.
>

I don't know if this will be helpful to you (and I appreciate there's still
the underlying PG issue), but there's a suggestion here that you can work
around this using .extra()

https://stackoverflow.com/a/38880144/321161

Geoff

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2018-10-04 14:55:03 Re: Multiple primary key on partition table?
Previous Message Tom Lane 2018-10-04 14:19:24 Re: executor relation handling