Re: Use opresulttype instead of calling SearchSysCache1() in match_orclause_to_indexcol()

From: Aleksander Alekseev <aleksander(at)tigerdata(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Tender Wang <tndrwang(at)gmail(dot)com>
Subject: Re: Use opresulttype instead of calling SearchSysCache1() in match_orclause_to_indexcol()
Date: 2025-09-19 14:11:23
Message-ID: CAJ7c6TMPeYemKv0Fu9aDf8eC1rBZbT=c9gVPA9p2xXkmpxwkew@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Tender,

> Although this would not improve performance, it can save some CPU time.
> Any thoughts?

The patch looks correct to me. The correctness can also be rechecked like this:

```
--- a/src/backend/optimizer/path/indxpath.c
+++ b/src/backend/optimizer/path/indxpath.c
@@ -3372,6 +3372,9 @@ match_orclause_to_indexcol(PlannerInfo *root,
/* Only the operator returning a boolean suit the
transformation. */
if (get_op_rettype(opno) != BOOLOID)
break;
+ else {
+ Assert(subClause->opresulttype == BOOLOID);
+ }
```

--
Best regards,
Aleksander Alekseev

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Timur Magomedov 2025-09-19 14:13:51 Re: [WIP]Vertical Clustered Index (columnar store extension) - take2
Previous Message Jonathan S. Katz 2025-09-19 14:10:04 Re: Having postgresql.org link to cgit instead of gitweb