From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: Andre Schubert <andre.schubert@km3.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: Indexing timestamps
Date: Fri, 7 Jun 2002 21:15:00 -0700 (PDT)
Message-ID: <20020607211334.I43015-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <200206080248.g582mPu22554@candle.pha.pa.us>
On Fri, 7 Jun 2002, Bruce Momjian wrote:
> Stephan Szabo wrote:
> > 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.
>
> We have all those new cacheable settings now to indicate things that can
> change during the transaction, function call, or never.
Yeah, it's marked static now. The comments implied that meant constant
for a particular scan which I'd guess means index scans are safe but I
didn't go looking through code or try examples to verify that.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: sszabo@megazone23.bigpanda.com, pgman@candle.pha.pa.us, josh@agliodbs.com, andre.schubert@km3.de
Subject: Re: Indexing timestamps
In-Reply-To: <20020607211334.I43015-100000@megazone23.bigpanda.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox