Re: TEXT column and indexing - Mailing list pgsql-performance

From Ian Barwick
Subject Re: TEXT column and indexing
Date
Msg-id 200311192016.48447.barwick@gmx.net
Whole thread Raw
In response to Re: TEXT column and indexing  (Manfred Koizar <mkoi-pg@aon.at>)
List pgsql-performance
On Wednesday 19 November 2003 17:26, you wrote:
> On Wed, 19 Nov 2003 10:18:18 +0100, Ian Barwick <barwick@gmx.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@gmx.net


pgsql-performance by date:

Previous
From: Ian Barwick
Date:
Subject: Re: TEXT column and indexing
Next
From: Ryszard Lach
Date:
Subject: Re: duration logging setting in 7.4