pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ian Barwick <barwick@gmx.net>
To: Manfred Koizar <mkoi-pg@aon.at>
Cc: pgsql-performance@postgresql.org
Subject: Re: TEXT column and indexing
Date: Wed, 19 Nov 2003 20:16:48 +0100
Message-ID: <200311192016.48447.barwick@gmx.net> (raw)
In-Reply-To: <o86nrvk658f8jfr503f8c9sidmk0hlnt8u@email.aon.at>
References: <200311191018.18492.barwick@gmx.net>
	<o86nrvk658f8jfr503f8c9sidmk0hlnt8u@email.aon.at>

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




view thread (5+ messages)

Message-ID: <200311192016.48447.barwick@gmx.net>
Permalink:  ../200311192016.48447.barwick@gmx.net/
Also on:    postgresql.org/message-id/200311192016.48447.barwick@gmx.net

 · 

reply

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-performance@postgresql.org
  Cc: barwick@gmx.net, mkoi-pg@aon.at
  Subject: Re: TEXT column and indexing
  In-Reply-To: <200311192016.48447.barwick@gmx.net>

* 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