Re: Implement missing join selectivity estimation for range types

Alena Rybakina <lena.ribackina@yandex.ru>

From: Alena Rybakina <lena.ribackina@yandex.ru>
To: Schoemans Maxime <maxime.schoemans@ulb.be>
Cc: Damir Belyalov <dam.bel07@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, SAKR Mahmoud <mahmoud.sakr@ulb.be>, Diogo Repas <diogo.repas@gmail.com>, LUO Zhicheng <zhicheng.luo@ulb.be>, Tomas Vondra <tomas.vondra@enterprisedb.com>, Andrey Lepikhov <a.lepikhov@postgrespro.ru>
Date: 2023-11-30T14:50:36Z
Lists: pgsql-hackers

Attachments

Hi!

Thank you for your work on the subject, I think it's a really useful 
feature and it allows optimizer to estimate more correctly clauses with 
such type of operator.

I rewieved your patch and noticed that some comments are repeated into 
multirangejoinsel functions, I suggest combining them.

The proposed changes are in the attached patch.


If this topic is about calculating selectivity, have you thought about 
adding cardinality calculation test for queries with this type of operator?

For example, you could form queries similar to those that you use in 
src/test/regress/sql/multirangetypes.sql and 
src/test/regress/sql/rangetypes.sql.

I added a few in the attached patch.

-- 
Regards,
Alena Rybakina