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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-hackers by date

  From Date Subject
Next Message Sean Davis 2006-03-24 02:58:15 Re: Bytea and perl
Previous Message Greg Sabino Mullane 2006-03-24 02:50:08 Re: Bytea and perl