pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Glaesmann <grzm@myrealbox.com>
Cc: pgsql-novice@postgresql.org
Subject: Re: Functional index problems. (Was: Many joins: monthly summaries S-L--O--W)
Date: Wed, 22 Oct 2003 22:53:58 -0400
Message-ID: <25982.1066877638@sss.pgh.pa.us> (raw)
In-Reply-To: <704FD876-04F0-11D8-81AE-0005029FC1A7@myrealbox.com>
References: <704FD876-04F0-11D8-81AE-0005029FC1A7@myrealbox.com>

Michael Glaesmann <grzm@myrealbox.com> writes:
> My final thought would be to continue using "functional index", noting
> that operators are a special class of function. Out of the above
> description of "value expression", I believe only functions and
> operators are allowed as expressions in the CREATE INDEX syntax,
> correct? (Besides referring to a column.)

Actually, you can use any scalar-valued expression that does not contain
a sub-SELECT or aggregate function.  (Aggregates would be meaningless
--- what are you aggregating over?  The prohibition of sub-SELECTs is
partly because we don't do planning for index expressions, which could
be fixed if anyone were sufficiently motivated, and partly because it
seems quite unlikely that the result of a SELECT could reasonably be
considered immutable.  We do *not* want to get into updating indexes for
reasons other than updates of the indexed row.)

I see your point that "functional index" is still a valid description,
but I'm inclined to bow to Peter's position that it has another meaning
that could distract people.  Presently I'm going to go with "expression
index" unless someone can provide a better choice.

			regards, tom lane



view thread (9+ messages)

Message-ID: <25982.1066877638@sss.pgh.pa.us>
Permalink:  ../25982.1066877638@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/25982.1066877638@sss.pgh.pa.us

 · 

reply

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: tgl@sss.pgh.pa.us, grzm@myrealbox.com, pgsql-novice@postgresql.org
  Subject: Re: Functional index problems. (Was: Many joins: monthly summaries S-L--O--W)
  In-Reply-To: <25982.1066877638@sss.pgh.pa.us>

* 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