Hello,
During the review of using extended statistics to improve join estimates
[1], I found some code level optimization opportunities which apply to
existing code as well. To make the discussion easier, open this new
thread.
I don't know how to name the thread name, just use the patch 1 for the
naming.
commit d228d9734e70b4f43ad824d736fb1279d2aad5fc (HEAD -> misc_stats)
Author: yizhi.fzh <yizhi.fzh@alibaba-inc.com>
Date: Mon Apr 8 11:43:37 2024 +0800
Fast path for empty clauselist in clauselist_selectivity_ext
It should be common in the real life, for example:
SELECT * FROM t1, t2 WHERE t1.a = t2.a AND t1.a > 3;
clauses == NIL at the scan level of t2.
This would also make some debug life happier.
commit e852ce631f9348d5d29c8a53090ee71f7253767c
Author: yizhi.fzh <yizhi.fzh@alibaba-inc.com>
Date: Mon Apr 8 11:13:57 2024 +0800
Improve FunctionCall2Coll with FunctionCallInvoke
If a FunctionCall2Coll is called multi times with the same FmgrInfo,
turning it into FunctionCallInvoke will be helpful since the later one
can use the shared FunctionCallInfo.
There are many other places like GITSTATE which have the similar
chances, but I'd see if such changes is necessary at the first
place.
[1]
https://www.postgresql.org/message-id/c8c0ff31-3a8a-7562-bbd3-78b2ec65f16c%40enterprisedb.com
--
Best Regards
Andy Fan