pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Merlin Moncure <mmoncure@gmail.com>
To: Mark Steben <msteben@autorevenue.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Are piped columns indexable
Date: Wed, 12 Mar 2008 16:55:26 -0400
Message-ID: <b42b73150803121355j439b91a7p7789e93255ed5d52@mail.gmail.com> (raw)
In-Reply-To: <013201c88480$fe93f990$14010a0a@dei26g028575>
References: <013201c88480$fe93f990$14010a0a@dei26g028575>

On Wed, Mar 12, 2008 at 4:38 PM, Mark Steben <msteben@autorevenue.com> wrote:
> Given table t with columns a, b, c, d
>
>   And index on t using btree (a,b)
>
>    Is this indexable:
>
>   Select * from t where a || b = '124cab'  (or whatever)
>
>     Assume a and b are defined as char(3)
> I have tried various op classes and so far have just gotten sequential scans


create index t_idx on t((a || b));

:-)

merlin



view thread (2+ messages)

Message-ID: <b42b73150803121355j439b91a7p7789e93255ed5d52@mail.gmail.com>
Permalink:  ../b42b73150803121355j439b91a7p7789e93255ed5d52@mail.gmail.com/
Also on:    postgresql.org/message-id/b42b73150803121355j439b91a7p7789e93255ed5d52@mail.gmail.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: mmoncure@gmail.com, msteben@autorevenue.com
  Subject: Re: Are piped columns indexable
  In-Reply-To: <b42b73150803121355j439b91a7p7789e93255ed5d52@mail.gmail.com>
  References: <013201c88480$fe93f990$14010a0a@dei26g028575> <b42b73150803121355j439b91a7p7789e93255ed5d52@mail.gmail.com>

* 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