Re: POC, WIP: OR-clause support for indexes - Mailing list pgsql-hackers

From jian he
Subject Re: POC, WIP: OR-clause support for indexes
Date
Msg-id CACJufxGz4xgb0=J3EG0fdPW_qc1qg2shXBQBpacCTa-4w4iosw@mail.gmail.com
Whole thread Raw
In response to Re: POC, WIP: OR-clause support for indexes  (Alexander Korotkov <aekorotkov@gmail.com>)
Responses Re: POC, WIP: OR-clause support for indexes
Re: POC, WIP: OR-clause support for indexes
List pgsql-hackers
assume v40 is the latest version.
in group_similar_or_args
we can add a bool variable so

bool        matched = false;
foreach(lc, orargs)
{
                if (match_index_to_operand(nonConstExpr, colnum, index))
                {
                    matches[i].indexnum = indexnum;
                    matches[i].colnum = colnum;
                    matches[i].opno = opno;
                    matches[i].inputcollid = clause->inputcollid;
                    matched = true;
                    break;
                }
}
...
    if (!matched)
        return orargs;
    /* Sort clauses to make similar clauses go together */
    qsort(matches, n, sizeof(OrArgIndexMatch), or_arg_index_match_cmp);
....


I guess it can save some cycles?



pgsql-hackers by date:

Previous
From: Yugo NAGATA
Date:
Subject: Re: Enhance create subscription reference manual
Next
From: Andres Freund
Date:
Subject: Re: Refactoring postmaster's code to cleanup after child exit