Re: Use extended statistics to estimate (Var op Var) clauses - Mailing list pgsql-hackers

From Mark Dilger
Subject Re: Use extended statistics to estimate (Var op Var) clauses
Date
Msg-id E2517511-7474-4E8B-88C4-12CCB2BC0591@enterprisedb.com
Whole thread Raw
In response to Re: Use extended statistics to estimate (Var op Var) clauses  (Zhihong Yu <zyu@yugabyte.com>)
List pgsql-hackers

> On Aug 28, 2021, at 10:18 AM, Zhihong Yu <zyu@yugabyte.com> wrote:
>
> I wonder if the queries with (a=a) or (a<a) clauses are worth this additional complexity to address.
> Has anyone seen such clause in production queries ?

You might expect clauses like WHERE FALSE to be unusual, but that phrase gets added quite a lot by query generators.
Somebodycould add "WHERE a != a" in a misguided attempt to achieve the same thing. 

I wouldn't be terribly surprised if query generators might generate queries with a variable number of tables joined
togetherwith comparisons between the joined tables, and in the degenerate case of only one table end up with a table
columncompared against itself. 

You could argue that those people need to fix their queries/generators to not do this sort of thing, but the end user
affectedby such queries may have little ability to fix it. 

—
Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company






pgsql-hackers by date:

Previous
From: Zhihong Yu
Date:
Subject: Re: Use extended statistics to estimate (Var op Var) clauses
Next
From: Justin Pryzby
Date:
Subject: extended stats objects are the only thing written like "%s"."%s"