Re: TEXT column and indexing

From: Ian Barwick <barwick(at)gmx(dot)net>
To: Manfred Koizar <mkoi-pg(at)aon(dot)at>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: TEXT column and indexing
Date: 2003-11-19 19:16:48
Message-ID: 200311192016.48447.barwick@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Wednesday 19 November 2003 17:26, you wrote:
> On Wed, 19 Nov 2003 10:18:18 +0100, Ian Barwick <barwick(at)gmx(dot)net>
>
> wrote:
> >Indexes:
> > [...]
> > "opv_v_ix" btree (substr(value, 1, 128))
> >
> >SELECT obj_property_id
> > FROM object_property_value opv
> > WHERE opv.value = 'foo'
>
> Try
> ... WHERE substr(opv.value, 1, 128) = 'foo'
>
> HTH.

Yup:
db=> explain
db-> SELECT obj_property_id
db-> FROM object_property_value opv
db-> WHERE substr(opv.value,1,128) = 'foo';
QUERY PLAN
------------------------------------------------------------------------------------------------
Index Scan using opv_v_ix on object_property_value opv (cost=0.00..4185.78
rows=1101 width=4)
Index Cond: (substr(value, 1, 128) = 'foo'::text)
(2 rows)

Many thanks

Ian Barwick
barwick(at)gmx(dot)net

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Ryszard Lach 2003-11-19 19:28:55 Re: duration logging setting in 7.4
Previous Message Ian Barwick 2003-11-19 19:13:42 Re: TEXT column and indexing