pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim C. Nasby <jnasby@pervasive.com>
To: Andrea Arcangeli <andrea@cpushare.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: NOT LIKE much faster than LIKE?
Date: Wed, 11 Jan 2006 15:02:21 -0600
Message-ID: <20060111210221.GD63175@pervasive.com> (raw)
In-Reply-To: <20060111203947.GL15897@opteron.random>
References: <20060110014447.GB18474@opteron.random>
	<20060111184032.GS3902@pervasive.com>
	<20060111203947.GL15897@opteron.random>

On Wed, Jan 11, 2006 at 09:39:47PM +0100, Andrea Arcangeli wrote:
> > CREATE INDEX indexname ON tablename ( position(' PREEMPT ' in kernel_version) );
> 
> The index only helps the above query with = 0 and not the one with != 0,
> but it seems not needed in practice.

Hrm. If you need indexing then, you'll probably have to do 2 indexes
with a WHERE clause...

CREATE INDEX ... WHERE position(...) = 0;
CREATE INDEX ... WHERE position(...) != 0;

I suspect this is because of a lack of stats for functional indexes.
-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461



view thread (26+ messages)  latest in thread

Message-ID: <20060111210221.GD63175@pervasive.com>
Permalink:  ../20060111210221.GD63175@pervasive.com/
Also on:    postgresql.org/message-id/20060111210221.GD63175@pervasive.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: jnasby@pervasive.com, andrea@cpushare.com
  Subject: Re: NOT LIKE much faster than LIKE?
  In-Reply-To: <20060111210221.GD63175@pervasive.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