From: Alvaro Herrera <alvherre@commandprompt.com>
To: Ulrich Habel <espero7757@gmx.net>
Cc: pgsql-performance@postgresql.org
Subject: Re: query planner: automatic rescribe of LIKE to BETWEEN ?
Date: Tue, 22 Aug 2006 13:45:39 -0400
Message-ID: <20060822174539.GD25475@alvh.no-ip.org> (raw)
In-Reply-To: <200608221922.59734.espero7757@gmx.net>
References: <200608221922.59734.espero7757@gmx.net>
Ulrich Habel wrote:
> Hello all,
> had an idea of optimizing a query that may work generally.
>
> In case a 'column' is indexed, following two alterations could be done
> I think:
>
> A)
>
> select ... where column ~ '^Foo' --> Seq Scan
This is not true. You can make this query use an index if you create it
with opclass varchar_pattern_ops or text_pattern_ops, as appropiate.
Thus you don't need any hack here.
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: alvherre@commandprompt.com, espero7757@gmx.net
Subject: Re: query planner: automatic rescribe of LIKE to BETWEEN ?
In-Reply-To: <20060822174539.GD25475@alvh.no-ip.org>
References: <200608221922.59734.espero7757@gmx.net> <20060822174539.GD25475@alvh.no-ip.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox