PostgreSQL Source Code git master
Loading...
Searching...
No Matches
cluster.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * cluster.h
4 * header file for postgres cluster command stuff
5 *
6 * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994-5, Regents of the University of California
8 *
9 * src/include/commands/cluster.h
10 *
11 *-------------------------------------------------------------------------
12 */
13#ifndef CLUSTER_H
14#define CLUSTER_H
15
16#include "nodes/parsenodes.h"
17#include "parser/parse_node.h"
18#include "storage/lock.h"
19#include "utils/relcache.h"
20
21
22/* flag bits for ClusterParams->options */
23#define CLUOPT_VERBOSE 0x01 /* print progress info */
24#define CLUOPT_RECHECK 0x02 /* recheck relation state */
25#define CLUOPT_RECHECK_ISCLUSTERED 0x04 /* recheck relation state for
26 * indisclustered */
27#define CLUOPT_ANALYZE 0x08 /* do an ANALYZE */
28
29/* options for CLUSTER */
30typedef struct ClusterParams
32 bits32 options; /* bitmask of CLUOPT_* */
34
35
36extern void ExecRepack(ParseState *pstate, RepackStmt *stmt, bool isTopLevel);
37
38extern void cluster_rel(RepackCommand command, Relation OldHeap, Oid indexOid,
39 ClusterParams *params);
41 LOCKMODE lockmode);
42extern void mark_index_clustered(Relation rel, Oid indexOid, bool is_internal);
43
45 char relpersistence, LOCKMODE lockmode);
50 bool is_internal,
53 char newrelpersistence);
54
55#endif /* CLUSTER_H */
TransactionId MultiXactId
Definition c.h:748
uint32 bits32
Definition c.h:627
uint32 TransactionId
Definition c.h:738
void check_index_is_clusterable(Relation OldHeap, Oid indexOid, LOCKMODE lockmode)
Definition cluster.c:508
void finish_heap_swap(Oid OIDOldHeap, Oid OIDNewHeap, bool is_system_catalog, bool swap_toast_by_content, bool check_constraints, bool is_internal, TransactionId frozenXid, MultiXactId cutoffMulti, char newrelpersistence)
Definition cluster.c:1455
void ExecRepack(ParseState *pstate, RepackStmt *stmt, bool isTopLevel)
Definition cluster.c:113
void cluster_rel(RepackCommand command, Relation OldHeap, Oid indexOid, ClusterParams *params)
Definition cluster.c:300
Oid make_new_heap(Oid OIDOldHeap, Oid NewTableSpace, Oid NewAccessMethod, char relpersistence, LOCKMODE lockmode)
Definition cluster.c:715
void mark_index_clustered(Relation rel, Oid indexOid, bool is_internal)
Definition cluster.c:568
#define stmt
int LOCKMODE
Definition lockdefs.h:26
RepackCommand
unsigned int Oid
static int fb(int x)
bits32 options
Definition cluster.h:31