Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7ab0ef5

Browse files
committed
Change cfs_fragmentation function
1 parent77cbc91 commit7ab0ef5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

‎doc/src/sgml/cfs.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@
308308
As it was mentioned before, CFS always appends updated blocks to the end of the compressed file. So physical size of the file
309309
can be greater than used size in this file. I.e. CFS file is fragmented and defragmentation is periodically performed by CFS
310310
garbage collector. <varname>cfs_fragmentation(relation)</varname> functions returns average fragmentation of relation files.
311-
It is calculated asrum of physical sizes of the files divided by sum ofused size of the files.
311+
It is calculated assum of physical sizes of the filesminus sum of used size of the filesdivided by sum ofphysical sizes of the files.
312312
</para>
313313

314314
<para>

‎src/backend/storage/file/cfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ Datum cfs_fragmentation(PG_FUNCTION_ARGS)
10641064
pfree(map_path);
10651065
relation_close(rel,AccessShareLock);
10661066
}
1067-
PG_RETURN_FLOAT8((double)physSize/usedSize);
1067+
PG_RETURN_FLOAT8((double)(physSize-usedSize)/physSize);
10681068
}
10691069

10701070
Datumcfs_gc_activity_processed_bytes(PG_FUNCTION_ARGS)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp