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
54fd5f6c
Commit
54fd5f6c
authored
Oct 23, 1998
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix from Jan for vacuum statistics loss.
parent
3037aace
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
+24
-4
src/backend/commands/vacuum.c
src/backend/commands/vacuum.c
+24
-4
No files found.
src/backend/commands/vacuum.c
View file @
54fd5f6c
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.
89 1998/10/23 01:02:08
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.
90 1998/10/23 16:49:24
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1792,8 +1792,16 @@ vc_updstats(Oid relid, int num_pages, int num_tuples, bool hasindex, VRelStats *
/* overwrite the existing statistics in the tuple */
if
(
VacAttrStatsEqValid
(
stats
))
{
Buffer
abuffer
;
/*
* We manipulate the heap tuple in the
* buffer, so we fetch it to get the
* buffer number
*/
atup
=
heap_fetch
(
ad
,
SnapshotNow
,
&
atup
->
t_ctid
,
&
abuffer
);
vc_setpagelock
(
ad
,
ItemPointerGetBlockNumber
(
&
atup
->
t_ctid
));
attp
=
(
Form_pg_attribute
)
GETSTRUCT
(
atup
);
if
(
stats
->
nonnull_cnt
+
stats
->
null_cnt
==
0
||
(
stats
->
null_cnt
<=
1
&&
stats
->
best_cnt
==
1
))
...
...
@@ -1822,7 +1830,14 @@ vc_updstats(Oid relid, int num_pages, int num_tuples, bool hasindex, VRelStats *
if
(
selratio
>
1
.
0
)
selratio
=
1
.
0
;
attp
->
attdisbursion
=
selratio
;
WriteNoReleaseBuffer
(
ItemPointerGetBlockNumber
(
&
atup
->
t_ctid
));
/*
* Invalidate the cache for the tuple
* and write the buffer
*/
RelationInvalidateHeapTuple
(
ad
,
atup
);
WriteNoReleaseBuffer
(
abuffer
);
ReleaseBuffer
(
abuffer
);
/* DO PG_STATISTIC INSERTS */
...
...
@@ -1875,10 +1890,15 @@ vc_updstats(Oid relid, int num_pages, int num_tuples, bool hasindex, VRelStats *
heap_close
(
sd
);
}
/*
* Invalidate the cached pg_class tuple and
* write the buffer
*/
RelationInvalidateHeapTuple
(
rd
,
rtup
);
/* XXX -- after write, should invalidate relcache in other backends */
WriteBuffer
(
ItemPointerGetBlockNumber
(
&
rtup
->
t_ctid
));
WriteNoReleaseBuffer
(
buffer
);
ReleaseBuffer
(
buffer
);
heap_close
(
rd
);
}
...
...
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