X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id F3DC49FB35F for ; Thu, 17 Aug 2006 02:21:35 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 28056-01 for ; Thu, 17 Aug 2006 05:21:25 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id 9CB209FB359 for ; Thu, 17 Aug 2006 02:21:24 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.7/8.13.7) with ESMTP id k7H5LF0F021392 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 16 Aug 2006 23:21:18 -0600 (MDT) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.6/8.13.6) with ESMTP id k7H5LEEb077200; Wed, 16 Aug 2006 23:21:14 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.6/8.13.6/Submit) id k7H5LE2O077199; Wed, 16 Aug 2006 23:21:14 -0600 (MDT) (envelope-from mfuhr) Date: Wed, 16 Aug 2006 23:21:14 -0600 From: Michael Fuhr To: Rob Tester Cc: pgsql-sql@postgresql.org Subject: Re: Help with optional parameters Message-ID: <20060817052114.GA77128@winnie.fuhr.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200608/131 X-Sequence-Number: 26089 On Wed, Aug 16, 2006 at 08:39:49PM -0700, Rob Tester wrote: > What is the best way to write a query and get the planner to use indexes > when you have optional parameters and columns that can contain NULL values? Have you considered building a query string and using EXECUTE? That's not as "neat" as a static query but it might be worth testing. -- Michael Fuhr