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
009d593c
Commit
009d593c
authored
Jul 19, 2002
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small performance improvement --- use indexscan not heapscan to find
pg_statistic rows to delete while dropping a relation.
parent
59a471fc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
src/backend/catalog/heap.c
src/backend/catalog/heap.c
+13
-8
No files found.
src/backend/catalog/heap.c
View file @
009d593c
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.21
0 2002/07/18 16:47:22
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.21
1 2002/07/19 22:21:17
tgl Exp $
*
*
*
*
* INTERFACE ROUTINES
* INTERFACE ROUTINES
...
@@ -793,7 +793,8 @@ heap_create_with_catalog(const char *relname,
...
@@ -793,7 +793,8 @@ heap_create_with_catalog(const char *relname,
* Formerly, this routine checked for child relations and aborted the
* Formerly, this routine checked for child relations and aborted the
* deletion if any were found. Now we rely on the dependency mechanism
* deletion if any were found. Now we rely on the dependency mechanism
* to check for or delete child relations. By the time we get here,
* to check for or delete child relations. By the time we get here,
* there are no children and we need only remove the pg_inherits rows.
* there are no children and we need only remove any pg_inherits rows
* linking this relation to its parent(s).
*/
*/
static
void
static
void
RelationRemoveInheritance
(
Relation
relation
)
RelationRemoveInheritance
(
Relation
relation
)
...
@@ -1743,21 +1744,25 @@ static void
...
@@ -1743,21 +1744,25 @@ static void
RemoveStatistics
(
Relation
rel
)
RemoveStatistics
(
Relation
rel
)
{
{
Relation
pgstatistic
;
Relation
pgstatistic
;
Heap
ScanDesc
scan
;
Sys
ScanDesc
scan
;
ScanKeyData
key
;
ScanKeyData
key
;
HeapTuple
tuple
;
HeapTuple
tuple
;
pgstatistic
=
heap_openr
(
StatisticRelationName
,
RowExclusiveLock
);
pgstatistic
=
heap_openr
(
StatisticRelationName
,
RowExclusiveLock
);
ScanKeyEntryInitialize
(
&
key
,
0x0
,
Anum_pg_statistic_starelid
,
ScanKeyEntryInitialize
(
&
key
,
0x0
,
F_OIDEQ
,
Anum_pg_statistic_starelid
,
F_OIDEQ
,
ObjectIdGetDatum
(
RelationGetRelid
(
rel
)));
ObjectIdGetDatum
(
RelationGetRelid
(
rel
)));
scan
=
heap_beginscan
(
pgstatistic
,
SnapshotNow
,
1
,
&
key
);
while
((
tuple
=
heap_getnext
(
scan
,
ForwardScanDirection
))
!=
NULL
)
scan
=
systable_beginscan
(
pgstatistic
,
StatisticRelidAttnumIndex
,
true
,
SnapshotNow
,
1
,
&
key
);
while
(
HeapTupleIsValid
(
tuple
=
systable_getnext
(
scan
)))
{
simple_heap_delete
(
pgstatistic
,
&
tuple
->
t_self
);
simple_heap_delete
(
pgstatistic
,
&
tuple
->
t_self
);
}
heap
_endscan
(
scan
);
systable
_endscan
(
scan
);
heap_close
(
pgstatistic
,
RowExclusiveLock
);
heap_close
(
pgstatistic
,
RowExclusiveLock
);
}
}
...
...
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