1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-15 19:21:59 +03:00

New version attached. The following is implemented:

- CLUSTER ALL clusters all the tables that have some index with
  indisclustered set and the calling user owns.
- CLUSTER tablename clusters the named table, using the index with
  indisclustered set.  If no index has the bit set, throws elog(ERROR).
- The multi-relation version (CLUSTER ALL) uses a multitransaction
  approach, similar to what VACUUM does.

Alvaro Herrera
This commit is contained in:
Bruce Momjian
2002-11-15 03:09:39 +00:00
parent 5b7eb4dd45
commit 8bc717cb88
8 changed files with 484 additions and 38 deletions

View File

@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.378 2002/11/15 02:50:08 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.379 2002/11/15 03:09:35 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@ -3761,6 +3761,8 @@ CreateConversionStmt:
*
* QUERY:
* cluster <index_name> on <qualified_name>
* cluster <qualified_name>
* cluster ALL
*
*****************************************************************************/
@ -3772,6 +3774,20 @@ ClusterStmt:
n->indexname = $2;
$$ = (Node*)n;
}
| CLUSTER qualified_name
{
ClusterStmt *n = makeNode(ClusterStmt);
n->relation = $2;
n->indexname = NULL;
$$ = (Node*)n;
}
| CLUSTER ALL
{
ClusterStmt *n = makeNode(ClusterStmt);
n->relation = NULL;
n->indexname = NULL;
$$ = (Node*)n;
}
;
/*****************************************************************************