From: Kenneth Marshall <ktm@rice.edu>
To: Rob Sargent <robjsargent@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: indexing longish string
Date: Tue, 30 Nov 2010 12:36:27 -0600
Message-ID: <20101130183627.GL19162@aart.is.rice.edu> (raw)
In-Reply-To: <4CF53B0B.8060906@gmail.com>
References: <4CF53797.4040806@gmail.com>
<AANLkTikG8WZobuN=i3GbRPjPH8FYZC9YC5oUdrOpUfUt@mail.gmail.com>
<4CF53B0B.8060906@gmail.com>
You can use a hash index for this. It's drawback is that it is not
yet WAL enabled and if your DB crashes you will need to rebuild the
index to fix the corruption. It works well(only) with equality
searches. If it is a scenario where you must have WAL, use a
function index based on the hash of the string.
Cheers,
Ken
On Tue, Nov 30, 2010 at 10:57:31AM -0700, Rob Sargent wrote:
> If the performance against an index doesn't cut it, we would be forced
> to choose just such an implementation, but if pg can do it straight up
> that would be less work for us. A good thing, to be sure.
>
> On 11/30/2010 10:50 AM, jose wrote:
> > Why don't you use some type of hash like md5 for indexing ?
> >
> > 2010/11/30 Rob Sargent <robjsargent@gmail.com>:
> >> Were we to create a table which included a text field for a small block
> >> of xml (100-1000 chars worth), would an index on that field be useful
> >> against exact match queries?
> >>
> >> We're wondering if a criterion such as "where 'a string expected to be
> >> of size range 100 to 500' = tabelWithStrings.stringSearched" would make
> >> good use of an index on "stringSearched" column.
> >>
> >> The key is that there will only be exact match queries.
> >>
> >> Thanks for your thoughts.
> >>
> >>
> >>
> >> --
> >> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> >> To make changes to your subscription:
> >> http://www.postgresql.org/mailpref/pgsql-sql
> >>
> >
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
>
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: ktm@rice.edu, robjsargent@gmail.com
Subject: Re: indexing longish string
In-Reply-To: <20101130183627.GL19162@aart.is.rice.edu>
* 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