X-Original-To: pgsql-general-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id B11529FA13E; Tue, 13 Jun 2006 13:04:25 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 93919-08; Tue, 13 Jun 2006 13:04:16 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- X-Greylist: from auto-whitelisted by SQLgrey- Received: from server10.araisoft.com (server10.araisoft.com [72.9.228.195]) by postgresql.org (Postfix) with ESMTP id CAE279F9316; Tue, 13 Jun 2006 13:04:15 -0300 (ADT) Received: from uni (adsl-69-235-160-36.dsl.irvnca.pacbell.net [69.235.160.36]) by server10.araisoft.com (Postfix) with ESMTP id 262E23D62034; Tue, 13 Jun 2006 09:04:14 -0700 (PDT) Reply-To: From: "Benjamin Arai" To: , Subject: Question about clustering multiple columns Date: Tue, 13 Jun 2006 09:04:15 -0700 Organization: Araisoft Message-ID: <002e01c68f03$05f00e10$6501a8c0@uni> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_002F_01C68EC8.59913610" X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 thread-index: AcaPAa1hG8/KtusrTQGYSpnCQ9zr5w== X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/636 X-Sequence-Number: 97008 This is a multi-part message in MIME format. ------=_NextPart_000_002F_01C68EC8.59913610 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0030_01C68EC8.59913610" ------=_NextPart_001_0030_01C68EC8.59913610 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, I have a database where there are three columns (name,date,data). The queries are almost always something like SELECT date,data FROM table WHERE name=blah AND date > 1/1/2005 AND date < 1/1/2006;. I currently have three B-tree indexes, one for each of the columns. Is clustering on date index going to be what I want, or do I need a index that contains both name and date? Benjamin Arai barai@cs.ucr.edu http://www.benjaminarai.com ------=_NextPart_001_0030_01C68EC8.59913610 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Hi,
 
I have = a database=20 where there are three columns (name,date,data).  The queries are = almost=20 always something like SELECT date,data FROM table WHERE name=3Dblah AND = date >=20 1/1/2005 AND date < 1/1/2006;.  I currently have three = B-tree=20 indexes, one for each of the columns.  Is clustering on date = index=20 going to be what I want, or do I need a index that contains both name = and=20 date?
 
Benjamin=20 Arai
barai@cs.ucr.edu
http://www.benjaminarai.com
 
 
------=_NextPart_001_0030_01C68EC8.59913610-- ------=_NextPart_000_002F_01C68EC8.59913610 Content-Type: text/x-vcard; name="barai@cs.ucr.edu.vcf" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="barai@cs.ucr.edu.vcf" BEGIN:VCARD VERSION:2.1 N:Arai;Benjamin FN:barai@cs.ucr.edu ORG:University of California, Riverside TITLE:PhD Student TEL;WORK;VOICE:(951) 827-2838 TEL;HOME;VOICE:(951) 682-6816 TEL;CELL;VOICE:(626) 378-2992 ADR;WORK;ENCODING=3DQUOTED-PRINTABLE:;;Department of Computer Science = and Engineering=3D0D=3D0AEngineering BU2, Room =3D 351=3D0D=3D0AUniversity of California;Riverside;CA;92521;United States = of Americ=3D a LABEL;WORK;ENCODING=3DQUOTED-PRINTABLE:Department of Computer Science = and Engineering=3D0D=3D0AEngineering BU2, Room 35=3D 1=3D0D=3D0AUniversity of California=3D0D=3D0ARiverside, CA = 92521=3D0D=3D0AUnited States =3D of America URL;WORK:http://www.benjaminarai.com EMAIL;PREF;INTERNET:barai@cs.ucr.edu REV:20060520T165426Z END:VCARD ------=_NextPart_000_002F_01C68EC8.59913610--