Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 0F49F4758EF for ; Thu, 6 Jun 2002 18:33:39 -0400 (EDT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id 76204475451 for ; Thu, 6 Jun 2002 18:33:29 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 4B30DD608; Thu, 6 Jun 2002 15:33:30 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 38D505C01; Thu, 6 Jun 2002 15:33:30 -0700 (PDT) Date: Thu, 6 Jun 2002 15:33:30 -0700 (PDT) From: Stephan Szabo To: Josh Berkus Cc: Andre Schubert , Subject: Re: Indexing timestamps In-Reply-To: <200206061041.52753.josh@agliodbs.com> Message-ID: <20020606152814.P30776-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200206/62 X-Sequence-Number: 8027 On Thu, 6 Jun 2002, Josh Berkus wrote: > > Stephan, > > > Unfortunately you can't do that in that sort of syntax. You'll > > need to create a function that returns the month and is marked > > as iscachable and use that function in the index creation and > > query. > > Hmmm. I take it that NOW() is not ISCACHABLE, and that's Andre's indexing > problem? What would be the pitfall of creating an alternate version of > NOW() that ISCACHABLE? I believe it was not marked as iscachable. I think it's now marked as static in dev sources which I would guess would mean that it could consider an index scan. I think with care an iscachable function that just called now() would probably be safe for interactive queries.