| From: | "Phillip Couto" <phillip(at)couto(dot)in> |
|---|---|
| To: | "Vitalii Tymchyshyn" <vit(at)tym(dot)im> |
| Cc: | "Clailson" <clailson(dot)dba(at)gmail(dot)com>,"pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org> |
| Subject: | Re: Optimization inner join |
| Date: | 2017-01-19 13:46:03 |
| Message-ID: | 07fa17ae-ed3c-42bb-8a63-e24093cbac3d@mtasv.net |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-performance |
I apologize my statement about NULL being used to join is incorrect as both Vitalii and Gustavo have both pointed out in their respective replies.
-----------------
Phillip Couto
> On Jan 19, 2017, at 08:30, Vitalii Tymchyshyn <vit(at)tym(dot)im> wrote:
>
>
> Hi.
>
> In SQL "null == any value" resolves to false, so optimizer can safely skip nulls from either side if any for the inner join.
>
> Best regards, Vitalii Tymchyshyn
>
> NULL is still a value that may be paired with a NULL in a.a
>
> The only optimization I could see is if the a.a column has NOT NULL defined while b.b does not have NOT NULL defined.
>
> Not sure if it is all that common. Curious what if you put b.b IS NOT NULL in the WHERE statement?
>
> -----------------
> Phillip Couto
>
>
>
>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2017-01-19 14:13:41 | Re: Optimization inner join |
| Previous Message | Vitalii Tymchyshyn | 2017-01-19 13:30:33 | Re: Optimization inner join |