RES: Does postgresql 9.0.4 use index on PREFIX%SUFFIX queries?

From: "Edson Carlos Ericksson Richter" <richter(at)simkorp(dot)com(dot)br>
To: "'PG-General Mailing List'" <pgsql-general(at)postgresql(dot)org>
Subject: RES: Does postgresql 9.0.4 use index on PREFIX%SUFFIX queries?
Date: 2011-09-27 13:39:36
Message-ID: 006401cc7d1a$e6ea05a0$b4be10e0$@com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> -----Mensagem original-----
> De: pgsql-general-owner(at)postgresql(dot)org [mailto:pgsql-general-
> owner(at)postgresql(dot)org] Em nome de Marti Raudsepp
> Enviada em: terça-feira, 27 de setembro de 2011 09:59
> Para: Alban Hertroys
> Cc: PG-General Mailing List
> Assunto: Re: [GENERAL] Does postgresql 9.0.4 use index on PREFIX%SUFFIX
> queries?
>
> Alban, you forgot to reply to the mailing list. Please use the "reply to
> all" button in your email client. :)
>
> On Tue, Sep 27, 2011 at 14:21, Alban Hertroys <haramrae(at)gmail(dot)com> wrote:
> > If performance is an issue, I'd suggest coding it as a C function.
> >
> > A quick google search turned up:
> > http://discuss.fogcreek.com/techInterview/default.asp?cmd=show&ixPost=
> > 2077
> > for possible implementations.
> >
> > Of course, for Postgres we'd use pmalloc/pfree instead of malloc/free,
> > as the result value will be a Datum.
>
> These can't be adapted directly because they don't behave right in
> UTF-8 encoding.
>
> However, there's already a C implementation in the "orafce" project, no
> point in reinventing the wheel:
> http://pgfoundry.org/projects/orafce/
>
> I have created a wiki page for collecting the most useful implementations.
> Anyone is welcome to improve:
> https://wiki.postgresql.org/wiki/Reverse_string

This wiki page is great! Best resource, for sure.

Would be nice to get precompiled binaries for orafce. It's very interesting package that IMHO should be included in main distro of Postgres.

For Linux it's easy to get and compile... but for Win64 it's harder... good C compilers in Win64 is a nightmare (even CygWin complains about everything on the ".h world").

I'll try one of the portable solutions (for Win dev stations) and use the orafce in Linux srevers.

Thanks for all the tips!

Regards,

Edson.

>
> (I didn't include Pavel Stehule's implementation because that only works
> on 9.0, not earlier. I did include another SQL implementation)
>
> Regards,
> Marti
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org) To make
> changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Edson Carlos Ericksson Richter 2011-09-27 13:59:03 RES: Does postgresql 9.0.4 use index on PREFIX%SUFFIX queries?
Previous Message Marti Raudsepp 2011-09-27 12:59:25 Re: Does postgresql 9.0.4 use index on PREFIX%SUFFIX queries?