Changeset: 9cd93eb9592a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9cd93eb9592a
Modified Files:
        gdk/gdk_strimps.c
Branch: strimps-updates
Log Message:

Map all characters to lowercase

When constructing the imprint for a string we first map all the
characters to lowercase. That way we trade some performance in
strimp filtering for correctness in ILIKE queries.

Measurements also show that performance increases (in some cases
dramatically) if the query pattern contains uppercase characters.


diffs (19 lines):

diff --git a/gdk/gdk_strimps.c b/gdk/gdk_strimps.c
--- a/gdk/gdk_strimps.c
+++ b/gdk/gdk_strimps.c
@@ -180,13 +180,10 @@ pair_at(PairIterator *pi, CharPair *p)
 {
        if (pi->pos >= pi->lim - 1)
                return false;
-#ifdef LOWERCASE_STRIMPS
+
        p->pbytes[0] = (uint8_t)tolower(*(pi->s + pi->pos));
        p->pbytes[1] = (uint8_t)tolower(*(pi->s + pi->pos + 1));
-#else
-       p->pbytes[0] = (uint8_t)*(pi->s + pi->pos);
-       p->pbytes[1] = (uint8_t)*(pi->s + pi->pos + 1);
-#endif
+
        p->psize = 2;
        p->idx = pairToIndex(p->pbytes[0], p->pbytes[1]);
        return true;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to