Re: Speed of exist

From: Bastiaan Olij <bastiaan(at)basenlily(dot)me>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Speed of exist
Date: 2013-02-19 10:18:55
Message-ID: 5123518F.30206@basenlily.me
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi Pavel,

That is what I've done in this particular case but there are parts where
I use exist checks in this way that are very cumbersome to write out
like that so I'm hoping there is a way to make the optimizer work with
existence checks in this way.

Cheers,

Bastiaan Olij

On 19/02/13 6:39 PM, Pavel Stehule wrote:
> 2013/2/19 Bastiaan Olij <bastiaan(at)basenlily(dot)me>:
>> Hi Andy,
>>
>> I've tried that with the same result. One subquery works beautifully,
>> two subqueries with an OR and it starts to do a sequential scan...
> try to rewrite OR to two SELECTs joined by UNION ALL
>
> Pavel
>

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2013-02-19 17:51:16 Re: High CPU usage / load average after upgrading to Ubuntu 12.04
Previous Message Tom Lane 2013-02-19 10:09:42 Re: slow query plans caused by under-estimation of CTE cardinality