Re: Functional index problems. (Was: Many joins: monthly summaries S-L--O--W)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Glaesmann <grzm(at)myrealbox(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Functional index problems. (Was: Many joins: monthly summaries S-L--O--W)
Date: 2003-10-23 02:53:58
Message-ID: 25982.1066877638@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice pgsql-sql

Michael Glaesmann <grzm(at)myrealbox(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Marcin Gil 2003-10-23 08:12:16 do large objects retain after drop database?
Previous Message Josh Berkus 2003-10-23 00:55:29 Re: [NOVICE] Functional index problems. (Was: Many joins: monthly summaries S-L--O--W)

Browse pgsql-sql by date

  From Date Subject
Next Message Abdul Wahab Dahalan 2003-10-23 07:46:04 List table with same column name
Previous Message Josh Berkus 2003-10-23 00:55:29 Re: [NOVICE] Functional index problems. (Was: Many joins: monthly summaries S-L--O--W)