Re: TEXT column and indexing
От
Ian Barwick
Тема
Re: TEXT column and indexing
Дата
Msg-id
200311192016.48447.barwick@gmx.net
Ответ на
Re: TEXT column and indexing (Manfred Koizar)
Список
Дерево обсуждения
TEXT column and indexing Ian Barwick <barwick@gmx.net>
Re: TEXT column and indexing Stephan Szabo <sszabo@megazone.bigpanda.com>
Re: TEXT column and indexing Ian Barwick <barwick@gmx.net>
Re: TEXT column and indexing Manfred Koizar <mkoi-pg@aon.at>
Re: TEXT column and indexing Ian Barwick <barwick@gmx.net>
On Wednesday 19 November 2003 17:26, you wrote:
> On Wed, 19 Nov 2003 10:18:18 +0100, Ian Barwick
>
> 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 по дате отправления