Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 5F7579F9BD2 for ; Mon, 5 Nov 2007 15:25:36 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 85445-05 for ; Mon, 5 Nov 2007 15:25:28 -0400 (AST) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.190]) by postgresql.org (Postfix) with ESMTP id CF65C9F9BEF for ; Mon, 5 Nov 2007 15:08:14 -0400 (AST) Received: by nf-out-0910.google.com with SMTP id f5so1176959nfh for ; Mon, 05 Nov 2007 11:08:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=IptQkNJViAH0QNxSf/AVX6znnTmMiqFU/cED0BefHAY=; b=OSoRUyG4L0DJVrJ36jY4mZx7e8gsZoIVzqCRGalKTmT93S4kPamhRl+L+lcpFVU78znrb6VGGYa+wiujiJ0a3+cMmBq+RPaMKAtDuZmlXYyayOOHsn/hifEHNS/QH71i1SyvXNfFW+UdbDOpEJ/K8gQjRS+J7C25fpOer1HUZaI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=gIWsL4N5TK1gpDGCm63jbIU/kMRq6NwsiJXSQBJZO99svRwIOa759IpTTPir/obkYpSKHiqdsBbEhTIBtf7dQX4kvnFbOFH+DN1kE2tQBDk0+muUmW8dbwTRZoka4TLiBQ6aZNlS/blMAjGlkhbTfagBujXGp0e2Ap8hfYLjLRc= Received: by 10.78.180.18 with SMTP id c18mr4055375huf.1194288187362; Mon, 05 Nov 2007 10:43:07 -0800 (PST) Received: by 10.78.197.6 with HTTP; Mon, 5 Nov 2007 10:43:07 -0800 (PST) Message-ID: <1d219a6f0711051043x569b7f51r4cee3353e6ea9f10@mail.gmail.com> Date: Mon, 5 Nov 2007 13:43:07 -0500 From: "Chris Hoover" To: "PGSQL Performance" Subject: Which index methodology is better?- MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/63 X-Sequence-Number: 27478 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