From: | Aleš Zelený <zeleny(dot)ales(at)gmail(dot)com> |
---|---|
To: | pgsql-general(at)lists(dot)postgresql(dot)org |
Subject: | Re: PostgreSQL 14.4 ERROR: out of memory issues |
Date: | 2022-08-07 19:47:09 |
Message-ID: | CAODqTUasg6XLWNs7+rKaSOar5qRFjYDqBzikf68HhK1gg92mRw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hello,
The problem Joe spotted is that a variable name is misspelled in one
> place. It should (probably) be external_complete_id, not
> _external_complete_id).
Oh, copy-paste issue :-)
> > better solution proposal?
>
> I think you can make that clearer by using IS [NOT] DISTINCT FROM:
>
> SELECT ... simple join of two tables...
> WHERE opd.id_data_provider = _id_data_provider
> AND external_id IS NOT DISTINCT FROM _external_id
> AND external_complete_id IS NOT DISTINCT FROM _external_complete_id
> ;
>
> However, your version may be faster, as last time I looked (it's been
> some time) the optimizer wasn't especially good at handlung DISTINCT
> FROM (probably because it's so rarely used).g
>
> Distinct from was the original version, but it ignores indexes, 130ms vs
0.3 ms, you are absolutely correct.
Kind regards
Ales Zeleny
From | Date | Subject | |
---|---|---|---|
Next Message | Wind | 2022-08-08 07:52:17 | tablesample clause doesnt support to be applied to subquery. |
Previous Message | Tomas Vondra | 2022-08-07 17:31:28 | Re: Expr. extended stats are skipped with equality operator |