Re: proposal: prefix function
От | Pavel Stehule |
---|---|
Тема | Re: proposal: prefix function |
Дата | |
Msg-id | CAFj8pRAKuWLJKa=YQmy_x_2=yDp_EG2F1TVxC90aLQ1OkO3Y_g@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: proposal: prefix function (Chris Travers <chris.travers@adjust.com>) |
Список | pgsql-hackers |
pá 21. 9. 2018 v 12:37 odesílatel Chris Travers <chris.travers@adjust.com> napsal:
On Fri, Sep 21, 2018 at 10:09 AM Pavel Stehule <pavel.stehule@gmail.com> wrote:Hican we implement prefix function for fast test if substr is prefix of some string?create or replace function prefix(str text, substr text)returns boolean as $$
select substr(str, 1, length(substr)) = substr
$$ language sql;This function can be very effective in C language. Now it should be implemented with like or regexp, what is significantly more expensive.These would just be wrappers around already existing internal functions, right?
maybe, I didn't do any research. If not, the implementation is on few lines.
Regards
Pavel
RegardsPavel--Best Regards,Chris TraversHead of DatabaseSaarbrücker Straße 37a, 10405 Berlin
В списке pgsql-hackers по дате отправления: