From: Christophe Pettus <xof@thebuild.com>
To: xinyuliu@umich.edu
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16625: Query Optimizer - Performance bug related to removal of unnecessary aggregate function
Date: Sat, 19 Sep 2020 08:57:24 -0700
Message-ID: <485F48DB-5655-434C-AAED-ACCD5B938CB4@thebuild.com> (raw)
In-Reply-To: <16625-07403f18463add24@postgresql.org>
References: <16625-07403f18463add24@postgresql.org>
> On Sep 18, 2020, at 20:32, PG Bug reporting form <noreply@postgresql.org> wrote:
[snip]
> First query:
> SELECT "s_suppkey"
> FROM "supplier"
> WHERE s_suppkey > 100;
>
> Second query:
> SELECT "s_suppkey"
> FROM "supplier"
> WHERE s_suppkey > 100
> GROUP BY s_suppkey;
[snip]
> [Expected Behavior]
> Since these two queries are semantically equivalent, we were hoping that
> PostgreSQL will return the same results in roughly the same amount of
> time.
These two queries are not semantically equivalent, as described. I might guess that the table definition has a primary key (or should have had) on "supplier"."s_suppkey", and thus the GROUP BY should be redundant, but there's nothing in the report or the query plans that indicate this is the case.
--
-- Christophe Pettus
xof@thebuild.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: xof@thebuild.com, xinyuliu@umich.edu
Subject: Re: BUG #16625: Query Optimizer - Performance bug related to removal of unnecessary aggregate function
In-Reply-To: <485F48DB-5655-434C-AAED-ACCD5B938CB4@thebuild.com>
References: <16625-07403f18463add24@postgresql.org> <485F48DB-5655-434C-AAED-ACCD5B938CB4@thebuild.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox