From: | "x" <noreply(at)postgresql(dot)org> |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org |
Subject: | BUG #4276: Feature request aggregate indexes |
Date: | 2008-07-01 13:27:49 |
Message-ID: | 200807011327.m61DRnZA028742@wwwmaster.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
The following bug has been logged online:
Bug reference: 4276
Logged by: x
Email address: noreply(at)postgresql(dot)org
PostgreSQL version: n/a
Operating system: n/a
Description: Feature request aggregate indexes
Details:
# CREATE INDEX count_star ON fscrbank (COUNT(*));
ERROR: cannot use aggregate function in index expression
Don't know how the architechture would handle it but this should be
possible.
Initialy the values would be calculated on the existing values.
Inserts, Deletes and updates would be passed through a trigger that appends,
reverses, reverses then appends respectively.
So in this example count finds 12 rows and value is 12.
Insert a new record and COUNT(*) increases value to 13.
Delete two records and COUNT(*) decreases value to 11.
Update a row and COUNT(*) decreases by 1 and increases by 1 leaving 11.
Similarly sum(field).
Initial sum(*) of [3,5,2,1]=11
Insert sum(*) [3], sum becomes 14
Delete sum(*) [5], sum becomes 5
Update sum(*) [2] becomes [7], sum becomes 3 becomes 10
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2008-07-01 14:32:36 | Re: BUG #4275: Multicolumn subquery expression not allowed on both sides of IS DISTINCT FROM |
Previous Message | Ati Rosselet | 2008-07-01 10:28:58 | Re: just a question re: submitted bug... |