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

From Tomas Vondra
Subject Re: Use extended statistics to estimate (Var op Var) clauses
Date
Msg-id 408649db-702d-8d5d-3294-a6ab673bc71e@enterprisedb.com
Whole thread Raw
In response to Re: Use extended statistics to estimate (Var op Var) clauses  (Zhihong Yu <zyu@yugabyte.com>)
Responses Re: Use extended statistics to estimate (Var op Var) clauses
List pgsql-hackers
On 8/31/21 00:14, Zhihong Yu wrote:
> Hi,
> For patch 0002,
> 
> +                   s1 = statext_clauselist_selectivity(root, clauses, 
> varRelid,
> +                                                       jointype, 
> sjinfo, rel,
> +                                                       
> &estimatedclauses, false);
> +
> +                   estimated = (bms_num_members(estimatedclauses) == 1);
> 
> I took a look at clauselist_apply_dependencies() (called by 
> statext_clauselist_selectivity) where estimatedclauses is modified.
> Since the caller would not use the returned Selectivity if number of 
> elements in estimatedclauses is greater than 1, I wonder
> if a parameter can be added to clauselist_apply_dependencies() which 
> indicates early return if the second element is added to estimatedclauses.
> 

Hmmm, I'm not sure I understand your point. Are you suggesting there's a 
bug in not updating the bitmap, or would this be an optimization? Can 
you give an example of a query affected by this?


regards

-- 
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Defining (and possibly skipping) useless VACUUM operations
Next
From: Michael Paquier
Date:
Subject: Re: Make pg_waldump report replication origin ID, LSN, and timestamp.