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

Commit8cd5149

Browse files
committed
more optimizations in finish_delayed_invalidation() and try_syscache_parent_search()
1 parentd499bc6 commit8cd5149

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

‎src/relation_info.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -652,19 +652,28 @@ finish_delayed_invalidation(void)
652652
{
653653
PartParentSearchsearch;
654654
Oidparent;
655+
List*fresh_rels=delayed_invalidation_parent_rels;
655656

656657
parent=get_parent_of_partition(vague_rel,&search);
657658

658659
switch (search)
659660
{
660661
/* It's still parent */
661662
casePPS_ENTRY_PART_PARENT:
662-
try_perform_parent_refresh(parent);
663+
{
664+
/* Skip if we've already refreshed this parent */
665+
if (!list_member_oid(fresh_rels,parent))
666+
try_perform_parent_refresh(parent);
667+
}
663668
break;
664669

665670
/* It *might have been* parent before (not in PATHMAN_CONFIG) */
666671
casePPS_ENTRY_PARENT:
667-
remove_pathman_relation_info(parent);
672+
{
673+
/* Skip if we've already refreshed this parent */
674+
if (!list_member_oid(fresh_rels,parent))
675+
try_perform_parent_refresh(parent);
676+
}
668677
break;
669678

670679
/* How come we still don't know?? */
@@ -793,7 +802,6 @@ try_syscache_parent_search(Oid partition, PartParentSearch *status)
793802
else
794803
{
795804
Relationrelation;
796-
Snapshotsnapshot;
797805
ScanKeyDatakey[1];
798806
SysScanDescscan;
799807
HeapTupleinheritsTuple;
@@ -809,7 +817,6 @@ try_syscache_parent_search(Oid partition, PartParentSearch *status)
809817
BTEqualStrategyNumber,F_OIDEQ,
810818
ObjectIdGetDatum(partition));
811819

812-
snapshot=RegisterSnapshot(GetLatestSnapshot());
813820
scan=systable_beginscan(relation,InheritsRelidSeqnoIndexId,
814821
true,NULL,1,key);
815822

@@ -835,7 +842,6 @@ try_syscache_parent_search(Oid partition, PartParentSearch *status)
835842
}
836843

837844
systable_endscan(scan);
838-
UnregisterSnapshot(snapshot);
839845
heap_close(relation,AccessShareLock);
840846

841847
returnparent;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp