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
922e53e6
Commit
922e53e6
authored
Nov 25, 1999
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable pg_statistic cache use.
parent
8f401e80
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
21 deletions
+25
-21
src/backend/catalog/indexing.c
src/backend/catalog/indexing.c
+3
-1
src/backend/commands/rename.c
src/backend/commands/rename.c
+8
-6
src/backend/commands/vacuum.c
src/backend/commands/vacuum.c
+9
-1
src/backend/utils/adt/selfuncs.c
src/backend/utils/adt/selfuncs.c
+5
-13
No files found.
src/backend/catalog/indexing.c
View file @
922e53e6
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.5
2 1999/11/24 16:52:31
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.5
3 1999/11/25 00:15:56
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -63,6 +63,8 @@ char *Name_pg_rewrite_indices[Num_pg_rewrite_indices] =
{
RewriteOidIndex
,
RewriteRulenameIndex
};
char
*
Name_pg_shadow_indices
[
Num_pg_shadow_indices
]
=
{
ShadowNameIndex
,
ShadowSysidIndex
};
char
*
Name_pg_statistic_indices
[
Num_pg_statistic_indices
]
=
{
StatisticRelidAttnumOpIndex
};
char
*
Name_pg_trigger_indices
[
Num_pg_trigger_indices
]
=
{
TriggerRelidIndex
,
TriggerConstrNameIndex
,
TriggerConstrRelidIndex
};
char
*
Name_pg_type_indices
[
Num_pg_type_indices
]
=
...
...
src/backend/commands/rename.c
View file @
922e53e6
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.3
6 1999/11/24 00:44:30
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.3
7 1999/11/25 00:15:57
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -56,7 +56,6 @@ renameatt(char *relname,
HeapTuple
reltup
,
oldatttup
,
newatttup
;
Relation
irelations
[
Num_pg_attr_indices
];
Oid
relid
;
/*
...
...
@@ -159,10 +158,13 @@ renameatt(char *relname,
heap_update
(
attrelation
,
&
oldatttup
->
t_self
,
oldatttup
,
NULL
);
/* keep system catalog indices current */
CatalogOpenIndices
(
Num_pg_attr_indices
,
Name_pg_attr_indices
,
irelations
);
CatalogIndexInsert
(
irelations
,
Num_pg_attr_indices
,
attrelation
,
oldatttup
);
CatalogCloseIndices
(
Num_pg_attr_indices
,
irelations
);
{
Relation
irelations
[
Num_pg_attr_indices
];
CatalogOpenIndices
(
Num_pg_attr_indices
,
Name_pg_attr_indices
,
irelations
);
CatalogIndexInsert
(
irelations
,
Num_pg_attr_indices
,
attrelation
,
oldatttup
);
CatalogCloseIndices
(
Num_pg_attr_indices
,
irelations
);
}
pfree
(
oldatttup
);
heap_close
(
attrelation
,
RowExclusiveLock
);
}
...
...
src/backend/commands/vacuum.c
View file @
922e53e6
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.12
5 1999/11/22 17:56:02
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.12
6 1999/11/25 00:15:57
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -24,6 +24,7 @@
#include "catalog/catalog.h"
#include "catalog/catname.h"
#include "catalog/index.h"
#include "catalog/indexing.h"
#include "catalog/pg_operator.h"
#include "catalog/pg_statistic.h"
#include "catalog/pg_type.h"
...
...
@@ -2446,6 +2447,13 @@ vc_updstats(Oid relid, int num_pages, int num_tuples, bool hasindex, VRelStats *
*/
heap_insert
(
sd
,
stup
);
{
Relation
irelations
[
Num_pg_statistic_indices
];
CatalogOpenIndices
(
Num_pg_statistic_indices
,
Name_pg_statistic_indices
,
irelations
);
CatalogIndexInsert
(
irelations
,
Num_pg_statistic_indices
,
sd
,
stup
);
CatalogCloseIndices
(
Num_pg_statistic_indices
,
irelations
);
}
/* release allocated space */
pfree
(
DatumGetPointer
(
values
[
Anum_pg_statistic_stacommonval
-
1
]));
pfree
(
DatumGetPointer
(
values
[
Anum_pg_statistic_staloval
-
1
]));
...
...
src/backend/utils/adt/selfuncs.c
View file @
922e53e6
...
...
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.4
2 1999/11/22 17:56:30
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.4
3 1999/11/25 00:15:57
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -588,11 +588,6 @@ getattstatistics(Oid relid, AttrNumber attnum, Oid typid, int32 typmod,
Datum
*
hival
)
{
Relation
rel
;
HeapScanDesc
scan
;
static
ScanKeyData
key
[
2
]
=
{
{
0
,
Anum_pg_statistic_starelid
,
F_OIDEQ
,
{
0
,
0
,
F_OIDEQ
}},
{
0
,
Anum_pg_statistic_staattnum
,
F_INT2EQ
,
{
0
,
0
,
F_INT2EQ
}}
};
bool
isnull
;
HeapTuple
tuple
;
HeapTuple
typeTuple
;
...
...
@@ -600,15 +595,13 @@ getattstatistics(Oid relid, AttrNumber attnum, Oid typid, int32 typmod,
rel
=
heap_openr
(
StatisticRelationName
,
AccessShareLock
);
key
[
0
].
sk_argument
=
ObjectIdGetDatum
(
relid
);
key
[
1
].
sk_argument
=
Int16GetDatum
((
int16
)
attnum
);
scan
=
heap_beginscan
(
rel
,
0
,
SnapshotNow
,
2
,
key
);
tuple
=
heap_getnext
(
scan
,
0
);
tuple
=
SearchSysCacheTuple
(
STATRELID
,
ObjectIdGetDatum
(
relid
),
Int16GetDatum
((
int16
)
attnum
),
0
,
0
);
/* staop is currently 0 */
if
(
!
HeapTupleIsValid
(
tuple
))
{
/* no such stats entry */
heap_endscan
(
scan
);
heap_close
(
rel
,
AccessShareLock
);
return
false
;
}
...
...
@@ -693,7 +686,6 @@ getattstatistics(Oid relid, AttrNumber attnum, Oid typid, int32 typmod,
}
}
heap_endscan
(
scan
);
heap_close
(
rel
,
AccessShareLock
);
return
true
;
}
...
...
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