> 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