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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

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: Fri, 24 Mar 2006 10:55:53 +0800
  • Message-id: <44235FB9(dot)5040202(at)calorieking(dot)com>

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




Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group