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

Commit07d8af5

Browse files
committed
pgstattuple: Use double consistently for percentages
pgstattuple uses data type double for other percentage calculationsand exposes those values to the users via the float8 data type.However, scanned_percent in struct output_type is of type uint64, eventhough it is later returned via Float8GetDatum(). Change it to usedouble to be inline with other percentages.Author: Bharath RupireddyReviewed-by: Peter EisentrautDiscussion:https://www.postgresql.org/message-id/36ee692b-232f-0484-ce94-dc39d82021ad%40enterprisedb.com
1 parent57796a0 commit07d8af5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎contrib/pgstattuple/pgstatapprox.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Datumpgstattuple_approx_internal(Oid relid, FunctionCallInfo fcinfo);
3838
typedefstructoutput_type
3939
{
4040
uint64table_len;
41-
uint64scanned_percent;
41+
doublescanned_percent;
4242
uint64tuple_count;
4343
uint64tuple_len;
4444
doubletuple_percent;
@@ -203,7 +203,7 @@ statapprox_heap(Relation rel, output_type *stat)
203203
*/
204204
if (nblocks!=0)
205205
{
206-
stat->scanned_percent=100*scanned /nblocks;
206+
stat->scanned_percent=100.0*scanned /nblocks;
207207
stat->tuple_percent=100.0*stat->tuple_len /stat->table_len;
208208
stat->dead_tuple_percent=100.0*stat->dead_tuple_len /stat->table_len;
209209
stat->free_percent=100.0*stat->free_space /stat->table_len;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp