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

From Aleksander Alekseev
Subject Re: Use opresulttype instead of calling SearchSysCache1() in match_orclause_to_indexcol()
Date
Msg-id CAJ7c6TMPeYemKv0Fu9aDf8eC1rBZbT=c9gVPA9p2xXkmpxwkew@mail.gmail.com
Whole thread Raw
In response to Use opresulttype instead of calling SearchSysCache1() in match_orclause_to_indexcol()  (Tender Wang <tndrwang@gmail.com>)
List 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



pgsql-hackers by date:

Previous
From: "Jonathan S. Katz"
Date:
Subject: Re: Having postgresql.org link to cgit instead of gitweb
Next
From: Timur Magomedov
Date:
Subject: Re: [WIP]Vertical Clustered Index (columnar store extension) - take2