Which index methodology is better?- - Mailing list pgsql-performance

From Chris Hoover
Subject Which index methodology is better?-
Date
Msg-id 1d219a6f0711051043x569b7f51r4cee3353e6ea9f10@mail.gmail.com
Whole thread Raw
Responses Re: Which index methodology is better?-  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Which index methodology is better?-  (Heikki Linnakangas <heikki@enterprisedb.com>)
List pgsql-performance
I have a question.

Consider this scenario.

Table customer (
customer_id int8,
customer_l_name varchar(35),
customer_f_name varchar(30),
customer_addr_1 varchar(100),\
customer_addr_2 varchar(100),
customer_city varchar(50),
customer_state char(2),
customer_zip varchar(9)
);

On this table, a customer can search by customer_id, customer_l_name,
and customer_f_name.

Is it better to create 3 indexes, or one index on the three columns?

I did some initial testing with index customer_test_idx(customer_id,
customer_l_name, customer_f_name) and postgres would use the index for
select * from customer where customer_f_name = 'zxy' - so the single
index will cover the three.

My question is, is this better?  Does it end up using less memory
and/or disk or more?  I am trying to find ways to keep more of my
customers databases in memory, and I am thinking that loading one
index is probably a little better than loading three.

Thanks for any advice,

Chris

PG 8.1
RH 4.0

pgsql-performance by date:

Previous
From: Erik Jones
Date:
Subject: Re: Migrating to 8.3 - checkpoints and background writer
Next
From: Tom Lane
Date:
Subject: Re: Which index methodology is better?-