Re: [PERF] Improve Cardinality Estimation for Joins with GROUP BY Having Single Clause

2025-03-20 Thread Ravi
Hi,  I initially applied this patch on the master branch at commit f95da9f, but I have noticed that the latest master branch already includes a fix for this issue. A similar patch was recently committed in e983ee9 successfully resolving this issue. Thanks for the update and assistance! Thanks

Re: [PERF] Improve Cardinality Estimation for Joins with GROUP BY Having Single Clause

2025-03-18 Thread Ilia Evdokimov
Hi, On commit 122a9af I can't see any problem with query: explain analyze select * from t1 left join (select a, max(b) from t2 group by a) t2 on t1.a = t2.a; QUERY PLAN

Re: [PERF] Improve Cardinality Estimation for Joins with GROUP BY Having Single Clause

2024-12-05 Thread Ravi
This issue occurs when the Aggregate node has more rows than the other node in the Join. The join selectivity is determined by the jselectivity factor, which is calculated based on the maximum number of distinct rows between the two nodes, as defined in the function eqjoinsel_inner. However, sin

Re: [PERF] Improve Cardinality Estimation for Joins with GROUP BY Having Single Clause

2024-11-27 Thread Alena Rybakina
Hi! On 27.11.2024 16:17, Ravi wrote: Please find the patch attached below for your review. Thanks & Regards, Ravi Revathy Member Technical Staff ZOHO Corporation On Wed, 27 Nov 2024 18:41:13 +0530 *Ravi * wrote --- Hi Developers,      Currently, PostgreS

Re: [PERF] Improve Cardinality Estimation for Joins with GROUP BY Having Single Clause

2024-11-27 Thread Ravi
Please find the patch attached below for your review. Thanks & Regards, Ravi Revathy Member Technical Staff ZOHO Corporation On Wed, 27 Nov 2024 18:41:13 +0530 Ravi wrote --- Hi Developers,      Currently, PostgreSQL relies on table statistics, extracted within the examine

[PERF] Improve Cardinality Estimation for Joins with GROUP BY Having Single Clause

2024-11-27 Thread Ravi
Hi Developers,      Currently, PostgreSQL relies on table statistics, extracted within the examine_simple_variable function, to estimate join selectivity. However, when dealing with subqueries that include GROUP BY clauses even for the single length clauses which result in distinct rows, the pl