Re: clustering by partial indexes

From: "Keith C(dot) Perry" <netadmin(at)vcsn(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: clustering by partial indexes
Date: 2005-11-09 15:25:53
Message-ID: 1131549953.4372150112912@webmail.vcsn.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Quoting Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:

> "Keith C. Perry" <netadmin(at)vcsn(dot)com> writes:
> > This might have been discussed before but I wanted to know if clustering
> tables
> > by partial indexes will be availble in a later release of pgSQL?
>
> What in the world would it mean to do that?

I'm not sure I understand your question. Right now you can cluster tables based
on an index but when I tried to do that with a partial index I got an error.
That information was in my first email. Perhaps a more basic question why can't
I cluster by a partial index. Here is the information again cut & pasted from
pgadminIII v1.4 (I omitted the table ddl previously).

CREATE TABLE report
(
"match" int4 NOT NULL,
"action" varchar(16),
stamp timestamptz NOT NULL,
account varchar(32),
ipaddress inet,
profile varchar(16),
rating text,
url text,
CONSTRAINT report_pkey PRIMARY KEY ("match", stamp)
)
WITHOUT OIDS;

CREATE INDEX hrs_idx
ON report
USING btree
(stamp)
WHERE thehour(stamp) >= 0::double precision AND thehour(stamp) <= 23::double
precision;

CREATE OR REPLACE FUNCTION thehour(timestamptz)
RETURNS float8 AS
$BODY$
begin
return extract(hour from $1);
end;
$BODY$
LANGUAGE 'plpgsql' IMMUTABLE;

Now when I go into the database with psql...

Welcome to psql 8.1.0, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

iprism=# \h cluster
Command: CLUSTER
Description: cluster a table according to an index
Syntax:
CLUSTER indexname ON tablename
CLUSTER tablename
CLUSTER

iprism=# cluster hrs_idx on report;
ERROR: cannot cluster on partial index "hrs_idx"
iprism=#

--
Keith C. Perry, MS E.E.
Director of Networks & Applications
VCSN, Inc.
http://vcsn.com

____________________________________
This email account is being host by:
VCSN, Inc : http://vcsn.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ian Harding 2005-11-09 15:26:58 psql scripts
Previous Message A. Kretschmer 2005-11-09 15:20:51 Re: Question on Insert / Update