X-Original-To: pgsql-novice-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id C75E4D1B515 for ; Thu, 23 Oct 2003 02:54:27 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 48965-03 for ; Wed, 22 Oct 2003 23:53:59 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 19BF6D1B531 for ; Wed, 22 Oct 2003 23:53:55 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id h9N2rwit025983; Wed, 22 Oct 2003 22:53:59 -0400 (EDT) To: Michael Glaesmann Cc: pgsql-novice@postgresql.org Subject: Re: Functional index problems. (Was: Many joins: monthly summaries S-L--O--W) In-reply-to: <704FD876-04F0-11D8-81AE-0005029FC1A7@myrealbox.com> References: <704FD876-04F0-11D8-81AE-0005029FC1A7@myrealbox.com> Comments: In-reply-to Michael Glaesmann message dated "Thu, 23 Oct 2003 09:32:53 +0900" Date: Wed, 22 Oct 2003 22:53:58 -0400 Message-ID: <25982.1066877638@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/196 X-Sequence-Number: 8633 Michael Glaesmann 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