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