diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-05-08 00:34:49 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-05-08 00:34:49 +0000 |
commit | dd16b7aa9e1ecbe6cdd83a742f4e1655d460b38d (patch) | |
tree | 8049deed7996450ad3e87b48f7a0d47233513953 /src/include/commands/cluster.h | |
parent | 7c6baade7b1c3decf37cc589427adee053be74f1 (diff) | |
download | postgresql-dd16b7aa9e1ecbe6cdd83a742f4e1655d460b38d.tar.gz postgresql-dd16b7aa9e1ecbe6cdd83a742f4e1655d460b38d.zip |
Get rid of cluster.c's apparatus for rebuilding a relation's indexes
in favor of using the REINDEX TABLE apparatus, which does the same thing
simpler and faster. Also, make TRUNCATE not use cluster.c at all, but
just assign a new relfilenode and REINDEX. This partially addresses
Hartmut Raschick's complaint from last December that 7.4's TRUNCATE is
an order of magnitude slower than prior releases. By getting rid of
a lot of unnecessary catalog updates, these changes buy back about a
factor of two (on my system). The remaining overhead seems associated
with creating and deleting storage files, which we may not be able to
do much about without abandoning transaction safety for TRUNCATE.
Diffstat (limited to 'src/include/commands/cluster.h')
-rw-r--r-- | src/include/commands/cluster.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/include/commands/cluster.h b/src/include/commands/cluster.h index d97be66d73a..820c9521080 100644 --- a/src/include/commands/cluster.h +++ b/src/include/commands/cluster.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1994-5, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/commands/cluster.h,v 1.22 2004/05/06 16:10:57 tgl Exp $ + * $PostgreSQL: pgsql/src/include/commands/cluster.h,v 1.23 2004/05/08 00:34:49 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -20,11 +20,8 @@ extern void cluster(ClusterStmt *stmt); extern void check_index_is_clusterable(Relation OldHeap, Oid indexOid); -extern void rebuild_relation(Relation OldHeap, Oid indexOid); +extern void mark_index_clustered(Relation rel, Oid indexOid); extern Oid make_new_heap(Oid OIDOldHeap, const char *NewName); -extern List *get_indexattr_list(Relation OldHeap, Oid *OldClusterIndex); -extern void rebuild_indexes(Oid OIDOldHeap, List *indexes, - Oid OIDClusterIndex); extern void swap_relfilenodes(Oid r1, Oid r2); #endif /* CLUSTER_H */ |