Re: [GENERAL] Functional index performance question

2003-09-30 Thread Greg Stark
Arguile <[EMAIL PROTECTED]> writes: > On Tue, 2003-09-30 at 07:06, Mike Mascari wrote: > [snip] > > CREATE INDEX i_employees ON employees(lower(name)); > > > > Let's also assume that the lower() function is computationally > > expensive. Now if I have a query like: > > > > SELECT lower(name) > >

Re: [GENERAL] Functional index performance question

2003-09-30 Thread Arguile
On Tue, 2003-09-30 at 09:54, Mike Mascari wrote: > Arguile wrote: > > > On Tue, 2003-09-30 at 07:06, Mike Mascari wrote: > > > >>CREATE INDEX i_employees ON employees(lower(name)); > >> > >>Let's also assume that the lower() function is computationally > >>expensive. Now if I have a query like: >

Re: [GENERAL] Functional index performance question

2003-09-30 Thread Mike Mascari
Arguile wrote: > On Tue, 2003-09-30 at 07:06, Mike Mascari wrote: > >>CREATE INDEX i_employees ON employees(lower(name)); >> >>Let's also assume that the lower() function is computationally >>expensive. Now if I have a query like: >> >>SELECT lower(name) >>FROM employees >>WHERE lower(name) = 'mik

Re: [GENERAL] Functional index performance question

2003-09-30 Thread Tom Lane
Arguile <[EMAIL PROTECTED]> writes: > On Tue, 2003-09-30 at 07:06, Mike Mascari wrote: >> SELECT lower(name) >> FROM employees >> WHERE lower(name) = 'mike' >> >> will PostgreSQL re-evaluate lower(name)? Is it necessary? > No, it won't re-evaluate. I think he's asking whether the lower(name) app

Re: [GENERAL] Functional index performance question

2003-09-30 Thread Arguile
On Tue, 2003-09-30 at 07:06, Mike Mascari wrote: [snip] > CREATE INDEX i_employees ON employees(lower(name)); > > Let's also assume that the lower() function is computationally > expensive. Now if I have a query like: > > SELECT lower(name) > FROM employees > WHERE lower(name) = 'mike' > > will

[GENERAL] Functional index performance question

2003-09-30 Thread Mike Mascari
Let's assume I have a table like so: CREATE TABLE employees ( employeeid text not null, name text not null ); CREATE INDEX i_employees ON employees(lower(name)); Let's also assume that the lower() function is computationally expensive. Now if I have a query like: SELECT lower(name) FROM emplo