Use opresulttype instead of calling SearchSysCache1() in match_orclause_to_indexcol() - Mailing list pgsql-hackers

From Tender Wang
Subject Use opresulttype instead of calling SearchSysCache1() in match_orclause_to_indexcol()
Date
Msg-id CAHewXN=aH7GQBk4fXU-WaEeVmQWUmBAeNyBfJ3VKzPphyPKUkQ@mail.gmail.com
Whole thread Raw
Responses Re: Use opresulttype instead of calling SearchSysCache1() in match_orclause_to_indexcol()
Re: Use opresulttype instead of calling SearchSysCache1() in match_orclause_to_indexcol()
List pgsql-hackers
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?

--
Thanks,
Tender Wang
Attachment

pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Having postgresql.org link to cgit instead of gitweb
Next
From: Tender Wang
Date:
Subject: Re: Fix typo in comment of match_orclause_to_indexcol()