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

Commit061bf98

Browse files
committed
pgstat: replace double lookup with IsSharedRelation()
As the list of shared relations is fixed, we can just dispatch basedIsSharedRelation(), instead of first trying to look up stats for a non-sharedrel and falling back to shared stats.Author: "Drouvot, Bertrand" <bertranddrouvot.pg@gmail.com>Reviewed-by: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>Reviewed-by: Andres Freund <andres@anarazel.deDiscussion:https://postgr.es/m/8c1851a2-a98e-e1bc-7729-37b0b95f66ec@gmail.com
1 parentb623037 commit061bf98

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

‎src/backend/utils/activity/pgstat_relation.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include"utils/pgstat_internal.h"
2626
#include"utils/rel.h"
2727
#include"utils/timestamp.h"
28+
#include"catalog/catalog.h"
2829

2930

3031
/* Record that's written to 2PC state file when pgstat state is persisted */
@@ -437,17 +438,7 @@ pgstat_update_heap_dead_tuples(Relation rel, int delta)
437438
PgStat_StatTabEntry*
438439
pgstat_fetch_stat_tabentry(Oidrelid)
439440
{
440-
PgStat_StatTabEntry*tabentry;
441-
442-
tabentry=pgstat_fetch_stat_tabentry_ext(false,relid);
443-
if (tabentry!=NULL)
444-
returntabentry;
445-
446-
/*
447-
* If we didn't find it, maybe it's a shared table.
448-
*/
449-
tabentry=pgstat_fetch_stat_tabentry_ext(true,relid);
450-
returntabentry;
441+
returnpgstat_fetch_stat_tabentry_ext(IsSharedRelation(relid),relid);
451442
}
452443

453444
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp