Hi,
While working on another issue, I stepped into match_orclause_to_indexcol().
I found below codes:
/* Only the operator returning a boolean suit the transformation. */
if (get_op_rettype(opno) != BOOLOID)
break;
In get_op_rettype, it calls SearchSysCache1() to get oprresult of Form_pg_operator.
I think we can use the opresulttype of OpExpr to achieve the same effect, but there is no need to call SearchSysCache1().
Although this would not improve performance, it can save some CPU time.
Any thoughts?
--