X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 8201AD1C921 for ; Fri, 25 Jul 2003 17:21:27 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 54025-08 for ; Fri, 25 Jul 2003 14:20:39 -0300 (ADT) Received: from lakemtao01.cox.net (lakemtao01.cox.net [68.1.17.244]) by svr1.postgresql.org (Postfix) with ESMTP id 7ECC9D1C91D for ; Fri, 25 Jul 2003 14:21:25 -0300 (ADT) Received: from [192.168.1.1] ([68.11.66.83]) by lakemtao01.cox.net (InterMail vM.5.01.04.05 201-253-122-122-105-20011231) with ESMTP id <20030725172126.CCTK7142.lakemtao01.cox.net@[192.168.1.1]> for ; Fri, 25 Jul 2003 13:21:26 -0400 Subject: Re: index questions From: Ron Johnson To: PgSQL Performance ML In-Reply-To: <1059151963.1183.14.camel@taz> References: <1059151963.1183.14.camel@taz> Content-Type: text/plain Message-Id: <1059153685.26037.135.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 25 Jul 2003 12:21:25 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/420 X-Sequence-Number: 2713 On Fri, 2003-07-25 at 11:52, Franco Bruno Borghesi wrote: [snip] > > > Will findSale() in the future, when I have *many* rows still use the > index when only the first couple of > arguments are passed to the function? > If not, should I create more indexes (and functions) for each possible > argument combination? (of course, with > the given order) > > The thing here is that I don't understand how postgreSQL solves the > query when the COALESCEs are used... it uses > the index now, with a few thowsand records, but what will happen in a > few months? When faced with cases like this, I cobble together a script/program that generates a few million rows of random data (within the confines of FKs, of course) to populate these tables like "sales", and then I see how things perform. -- +-----------------------------------------------------------------+ | Ron Johnson, Jr. Home: ron.l.johnson@cox.net | | Jefferson, LA USA | | | | "I'm not a vegetarian because I love animals, I'm a vegetarian | | because I hate vegetables!" | | unknown | +-----------------------------------------------------------------+