Re: [HACKERS] Re: [GENERAL] indexed regex select optimisation missing?

From: Charles Tassell <ctassell(at)isn(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Ross J(dot) Reedstrom" <reedstrm(at)wallace(dot)ece(dot)rice(dot)edu>
Cc: Stuart Woolford <stuartw(at)newmail(dot)net>, pgsql-general(at)postgreSQL(dot)org, Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>, hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Re: [GENERAL] indexed regex select optimisation missing?
Date: 1999-11-06 21:13:03
Message-ID: 4.2.0.58.19991106170952.00a6c7b0@mailer.isn.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

I don't know much about the backend stuff, but wouldn't it reduce the
amount of records you go through to do a search for FO. and then do a
another check on each returned record to check that the last character
matches? More checks, but fewer total records.

Anyway, just a thought.

At 12:46 PM 11/5/99, Tom Lane wrote:
>[snip]
>
> Basically, given that we know the LIKE or regex
>pattern can only match values beginning with FOO, we want to generate
>string comparisons that select out the range of values that begin with
>FOO (or, at worst, a slightly larger range). In USASCII locale it's not
>hard: you can do
> field >= 'FOO' AND field < 'FOP'
>but it's not immediately obvious how to make this idea work reliably
>in the presence of odd collation orders or multibyte characters...
>
>BTW: the \377 hack is actually wrong for USASCII too, since it'll
>exclude a data value like 'FOO\377x' which should be included.
>
> regards, tom lane
>
>************

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavol Sutor 1999-11-06 23:31:46 postrgresql and windows nt
Previous Message Peter Eisentraut 1999-11-06 14:59:29 Re: [GENERAL] Banner (fwd)

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Lockhart 1999-11-06 21:20:17 Re: [HACKERS] PostgreSQL 6.5.3 built, but not released ...
Previous Message Tom Lane 1999-11-06 21:12:42 Re: [HACKERS] Arrays broken on temp tables