Re: [PERFORM] How to query and index for customer with lastname and city

2006-03-04 Thread Kevin Brown
On Saturday 04 March 2006 08:23, hubert depesz lubaczewski wrote: > On 3/4/06, Joost Kraaijeveld <[EMAIL PROTECTED]> wrote: > > > how many record do you have in the customers table? > > > > 368915 of which 222465 actually meet the condition. > > > > >From what I understand from the mailing list, Po

Re: [PERFORM] How to query and index for customer with lastname and city

2006-03-04 Thread hubert depesz lubaczewski
On 3/4/06, Joost Kraaijeveld <[EMAIL PROTECTED]> wrote: > > how many record do you have in the customers table? > 368915 of which 222465 actually meet the condition. > >From what I understand from the mailing list, PostgreSQL prefers a table > scan whenever it expects that the number of records in

Re: [PERFORM] How to query and index for customer with lastname

2006-03-04 Thread Joost Kraaijeveld
Hi Hubert, On Sat, 2006-03-04 at 14:49 +0100, hubert depesz lubaczewski wrote: > > Sort (cost=54710.68..54954.39 rows=97484 width=111) (actual > > time=7398.971..7680.405 rows=96041 loops=1) > >Sort Key: btrim(upper(customers.lastname)), btrim(upper(addresses.city)) > >-> Hash Join (co

Re: [PERFORM] How to query and index for customer with lastname and city

2006-03-04 Thread hubert depesz lubaczewski
On 3/4/06, Joost Kraaijeveld <[EMAIL PROTECTED]> wrote: > Below is what I actually have. Given the fact that it takes forever to get > a result (> 6 seconds) , there must be something wrong with my solution or > my expectation. Can anyone tell what I should do to make this query go > faster ( or c