Skip site navigation (1) Skip section navigation (2)

Worthwhile optimisation of position()?

From: Christopher Kings-Lynne <chris(dot)kings-lynne(at)calorieking(dot)com>
To: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Worthwhile optimisation of position()?
Date: 2006-03-24 02:55:53
Message-ID: 44235FB9.5040202@calorieking.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Is it worth allowing this:

select count(*) from users_users where position('ch' in username) = 0;

To be able to use an index, like:

select count(*) from users_users where username like 'ch%';

At the moment the position() syntax will do a seqscan, but the like 
syntax will use an index.

Chris


Responses

pgsql-hackers by date

Next:From: Sean DavisDate: 2006-03-24 02:58:15
Subject: Re: Bytea and perl
Previous:From: Greg Sabino MullaneDate: 2006-03-24 02:50:08
Subject: Re: Bytea and perl

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group