Re: BUG #16625: Query Optimizer - Performance bug related to removal of unnecessary aggregate function - Mailing list pgsql-bugs

From Christophe Pettus
Subject Re: BUG #16625: Query Optimizer - Performance bug related to removal of unnecessary aggregate function
Date
Msg-id 485F48DB-5655-434C-AAED-ACCD5B938CB4@thebuild.com
Whole thread Raw
In response to BUG #16625: Query Optimizer - Performance bug related to removal of unnecessary aggregate function  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #16625: Query Optimizer - Performance bug related to removal of unnecessary aggregate function  (Xinyu Liu <xinyuliu@umich.edu>)
List pgsql-bugs

> 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
thereport or the query plans that indicate this is the case. 
--
-- Christophe Pettus
   xof@thebuild.com




pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #16625: Query Optimizer - Performance bug related to removal of unnecessary aggregate function
Next
From: Xinyu Liu
Date:
Subject: Re: BUG #16625: Query Optimizer - Performance bug related to removal of unnecessary aggregate function