pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dave Cramer <pg@fastcrypt.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: postgresql performance list <pgsql-performance@postgresql.org>
Subject: Re: difference between a unique constraint and a unique index ???
Date: Mon, 12 Nov 2007 13:32:34 -0500
Message-ID: <694A5959-73AC-4C18-AA5F-489407A6CFDC@fastcrypt.com> (raw)
In-Reply-To: <6836.1194885434@sss.pgh.pa.us>
References: <E9D1152F-7846-4F03-A435-F1C05E034000@fastcrypt.com>
	<20071112145630.GC14247@alvh.no-ip.org>
	<6836.1194885434@sss.pgh.pa.us>


On 12-Nov-07, at 11:37 AM, Tom Lane wrote:

> Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
>> Well, AFAIK the index with varchar_pattern_ops is used for LIKE  
>> queries,
>> whereas the other one is going to be used for = queries.  So you  
>> need to
>> keep both indexes.
>
> Given the current definition of text equality, it'd be possible to  
> drop
> ~=~ and have the standard = operator holding the place of equality in
> both the regular and pattern_ops opclasses.  Then it'd be possible to
> support regular equality queries, as well as LIKE, with only the
> pattern_ops index.
>
That would be ideal. Having two indexes on the same column isn't  
optimal.

Dave



view thread (5+ messages)

Message-ID: <694A5959-73AC-4C18-AA5F-489407A6CFDC@fastcrypt.com>
Permalink:  ../694A5959-73AC-4C18-AA5F-489407A6CFDC@fastcrypt.com/
Also on:    postgresql.org/message-id/694A5959-73AC-4C18-AA5F-489407A6CFDC@fastcrypt.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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: pg@fastcrypt.com, tgl@sss.pgh.pa.us, alvherre@alvh.no-ip.org
  Subject: Re: difference between a unique constraint and a unique index ???
  In-Reply-To: <694A5959-73AC-4C18-AA5F-489407A6CFDC@fastcrypt.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