[PATCH] Erase the distinctClause if the result is unique by definition

From: Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: [PATCH] Erase the distinctClause if the result is unique by definition
Date: 2020-01-31 12:39:37
Message-ID: CAKU4AWqZvSyxroHkbpiHSCEAY2C41dG7VWs=c188KKznSK_2Zg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi:

I wrote a patch to erase the distinctClause if the result is unique by
definition, I find this because a user switch this code from oracle
to PG and find the performance is bad due to this, so I adapt pg for
this as well.

This patch doesn't work for a well-written SQL, but some drawback
of a SQL may be not very obvious, since the cost of checking is pretty
low as well, so I think it would be ok to add..

Please see the patch for details.

Thank you.

Attachment Content-Type Size
0001-Erase-the-distinctClause-if-the-result-is-unique-by-.patch application/octet-stream 23.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message ahsan hadi 2020-01-31 12:54:33 Re: pg_restore crash when there is a failure before all child process is created
Previous Message Fujii Masao 2020-01-31 12:39:01 Re: table partitioning and access privileges