Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
ab82bde7
Commit
ab82bde7
authored
Sep 03, 2002
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code review and documentation updates for indisclustered patch.
parent
00482fde
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
21 deletions
+22
-21
doc/src/sgml/catalogs.sgml
doc/src/sgml/catalogs.sgml
+2
-2
src/backend/catalog/index.c
src/backend/catalog/index.c
+2
-2
src/backend/commands/cluster.c
src/backend/commands/cluster.c
+16
-15
src/include/catalog/pg_index.h
src/include/catalog/pg_index.h
+2
-2
No files found.
doc/src/sgml/catalogs.sgml
View file @
ab82bde7
<!--
Documentation of the system catalogs, directed toward PostgreSQL developers
$Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.5
8 2002/09/02 05:52:34 momjian
Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.5
9 2002/09/03 01:04:40 tgl
Exp $
-->
<chapter id="catalogs">
...
...
@@ -1865,7 +1865,7 @@
<entry>indisclustered</entry>
<entry><type>bool</type></entry>
<entry></entry>
<entry>
unused
</entry>
<entry>
If true, the table was last clustered on this index.
</entry>
</row>
<row>
...
...
src/backend/catalog/index.c
View file @
ab82bde7
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.19
3 2002/09/02 01:05:04
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.19
4 2002/09/03 01:04:41
tgl Exp $
*
*
* INTERFACE ROUTINES
...
...
@@ -453,7 +453,7 @@ UpdateIndexRelation(Oid indexoid,
indexForm
->
indexrelid
=
indexoid
;
indexForm
->
indrelid
=
heapoid
;
indexForm
->
indproc
=
indexInfo
->
ii_FuncOid
;
indexForm
->
indisclustered
=
false
;
/* not
used
*/
indexForm
->
indisclustered
=
false
;
/* not
clustered, yet
*/
indexForm
->
indisunique
=
indexInfo
->
ii_Unique
;
indexForm
->
indisprimary
=
primary
;
memcpy
((
char
*
)
&
indexForm
->
indpred
,
(
char
*
)
predText
,
predLen
);
...
...
src/backend/commands/cluster.c
View file @
ab82bde7
...
...
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.8
8 2002/09/02 01:05:04
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.8
9 2002/09/03 01:04:41
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -304,12 +304,7 @@ get_indexattr_list(Relation OldHeap, Oid OldIndex)
palloc
(
sizeof
(
Oid
)
*
attrs
->
indexInfo
->
ii_NumIndexAttrs
);
memcpy
(
attrs
->
classOID
,
indexForm
->
indclass
,
sizeof
(
Oid
)
*
attrs
->
indexInfo
->
ii_NumIndexAttrs
);
/* We'll set indisclustered at index creation time on the
* index we are currently clustering, and reset it on other
* indexes.
*/
attrs
->
isclustered
=
(
OldIndex
==
indexOID
?
true
:
false
);
attrs
->
isclustered
=
(
OldIndex
==
indexOID
);
/* Name and access method of each index come from pg_class */
classTuple
=
SearchSysCache
(
RELOID
,
...
...
@@ -373,19 +368,25 @@ recreate_indexattr(Oid OIDOldHeap, List *indexes)
CommandCounterIncrement
();
/* Set indisclustered to the correct value. Only one index is
* allowed to be clustered.
/*
* Make sure that indisclustered is correct: it should be set
* only for the index we just clustered on.
*/
pg_index
=
heap_openr
(
IndexRelationName
,
RowExclusiveLock
);
tuple
=
SearchSysCacheCopy
(
INDEXRELID
,
ObjectIdGetDatum
(
attrs
->
indexOID
),
0
,
0
,
0
);
if
(
!
HeapTupleIsValid
(
tuple
))
elog
(
ERROR
,
"cache lookup failed for index %u"
,
attrs
->
indexOID
);
index
=
(
Form_pg_index
)
GETSTRUCT
(
tuple
);
if
(
index
->
indisclustered
!=
attrs
->
isclustered
)
{
index
->
indisclustered
=
attrs
->
isclustered
;
simple_heap_update
(
pg_index
,
&
tuple
->
t_self
,
tuple
);
CatalogUpdateIndexes
(
pg_index
,
tuple
);
}
heap_freetuple
(
tuple
);
heap_close
(
pg_index
,
No
Lock
);
heap_close
(
pg_index
,
RowExclusive
Lock
);
/* Destroy new index with old filenode */
object
.
classId
=
RelOid_pg_class
;
...
...
src/include/catalog/pg_index.h
View file @
ab82bde7
...
...
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_index.h,v 1.2
8 2002/06/20 20:29:44 momjian
Exp $
* $Id: pg_index.h,v 1.2
9 2002/09/03 01:04:41 tgl
Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
...
...
@@ -38,7 +38,7 @@ CATALOG(pg_index) BKI_WITHOUT_OIDS
regproc
indproc
;
/* OID of function for functional index */
int2vector
indkey
;
/* column numbers of indexed attributes */
oidvector
indclass
;
/* opclass identifiers */
bool
indisclustered
;
/*
presently unused
*/
bool
indisclustered
;
/*
is this the index last clustered by?
*/
bool
indisunique
;
/* is this a unique index? */
bool
indisprimary
;
/* is this index for primary key? */
Oid
indreference
;
/* oid of index of referenced relation (ie
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment