Re: Strange (?) Index behavior?

From: "Matt Clark" <matt(at)ymogen(dot)net>
To: "'Allen Landsidel'" <alandsidel(at)gmail(dot)com>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Strange (?) Index behavior?
Date: 2004-11-05 15:06:32
Message-ID: 007a01c4c349$092cdae0$8300a8c0@solent
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

> For some reason it's a requirement that partial wildcard
> searches are done on this field, such as "SELECT ... WHERE
> field LIKE 'A%'"
>
> I thought an interesting way to do this would be to simply
> create partial indexes for each letter on that field, and it
> works when the query matches the WHERE clause in the index
> exactly like above. The problem is thus:

I thought PG could use an ordinary index for 'like' conditions with just a
terminating '%'?

My other thought is that like 'A%' should grab about 1/26th of the table
anyway (if the initial character distribution is random), and so a
sequential scan might be the best plan anyway...

M

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Rod Taylor 2004-11-05 15:07:38 Re: Strange (?) Index behavior?
Previous Message Allen Landsidel 2004-11-05 14:39:16 Strange (?) Index behavior?