Re: TODO item: Implement Boyer-Moore searching in LIKE queries - Mailing list pgsql-hackers

From Karan Sikka
Subject Re: TODO item: Implement Boyer-Moore searching in LIKE queries
Date
Msg-id CALkFZpeMbm6KQ_tLen17A3+DQj=FQeE7rXHsh+mytL9w-icZFg@mail.gmail.com
Whole thread Raw
In response to Re: TODO item: Implement Boyer-Moore searching in LIKE queries  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: TODO item: Implement Boyer-Moore searching in LIKE queries  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> Having said that, I've had a bee in my bonnet for a long time about
> removing per-row setup cost for repetitive regex matches, and
> whatever infrastructure that needs would work for this too.

What are the per-row setup costs for regex matches? I looked at
`regexp.c` and saw:

```
/*
 * We cache precompiled regular expressions using a "self organizing list"
 * structure, in which recently-used items tend to be near the front.
 * Whenever we use an entry, it's moved up to the front of the list.
 * Over time, an item's average position corresponds to its frequency of use.
 *
```

What proverbial bee did you have in your bonnet about the current regex
implementation?
Which functions other than `strpos` and `LIKE` would benefit from a similar
cache, or perhaps a query-scoped cache?

In the mean time I'll look at other TODOs that catch my interest.
Feel free to point me in the direction of one that you think is
both desirable and easy enough for a beginner.

Thanks!
Karan

pgsql-hackers by date:

Previous
From: Claudio Freire
Date:
Subject: Re: Server crash due to SIGBUS(Bus Error) when trying to access the memory created using dsm_create().
Next
From: Tom Lane
Date:
Subject: Re: TODO item: Implement Boyer-Moore searching in LIKE queries