From 87b99093f8bffc6ac961efd44c99ce5a70d94c6e Mon Sep 17 00:00:00 2001 From: gaoyang Date: Sun, 25 Jun 2023 23:27:09 -0700 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3IUD=E5=BA=95=E5=99=AA?= =?UTF-8?q?=E6=B6=88=E9=99=A4=E5=AF=B9tpcc=E6=80=A7=E8=83=BD=E5=BD=B1?= =?UTF-8?q?=E5=93=8D=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../runtime/executor/execUtils.cpp | 21 ------------------- .../runtime/opfusion/opfusion_delete.cpp | 2 +- .../runtime/opfusion/opfusion_insert.cpp | 2 +- .../runtime/opfusion/opfusion_update.cpp | 2 +- src/gausskernel/storage/buffer/bufmgr.cpp | 6 +++++- src/include/executor/executor.h | 1 - 6 files changed, 8 insertions(+), 26 deletions(-) diff --git a/src/gausskernel/runtime/executor/execUtils.cpp b/src/gausskernel/runtime/executor/execUtils.cpp index 50de2f74c..06d632b61 100644 --- a/src/gausskernel/runtime/executor/execUtils.cpp +++ b/src/gausskernel/runtime/executor/execUtils.cpp @@ -1300,28 +1300,7 @@ void ExecCloseIndices(ResultRelInfo* resultRelInfo) * such stuff will be cleaned up automatically in FreeExecutorState. */ } -void OpFusionExecCloseIndices(ResultRelInfo* resultRelInfo) -{ - int i; - int numIndices; - RelationPtr indexDescs; - numIndices = resultRelInfo->ri_NumIndices; - indexDescs = resultRelInfo->ri_IndexRelationDescs; - - for (i = 0; i < numIndices; i++) { - if (indexDescs[i] == NULL) - continue; /* shouldn't happen? */ - - /* Drop lock acquired by ExecOpenIndices */ - index_close(indexDescs[i], NoLock); - } - - /* - * XXX should free indexInfo array here too? Currently we assume that - * such stuff will be cleaned up automatically in FreeExecutorState. - */ -} /* * Copied from ExecInsertIndexTuples */ diff --git a/src/gausskernel/runtime/opfusion/opfusion_delete.cpp b/src/gausskernel/runtime/opfusion/opfusion_delete.cpp index 6055f95f3..3dd11d7b3 100644 --- a/src/gausskernel/runtime/opfusion/opfusion_delete.cpp +++ b/src/gausskernel/runtime/opfusion/opfusion_delete.cpp @@ -284,7 +284,7 @@ bool DeleteFusion::execute(long max_rows, char *completionTag) /* *************** * step 3: done * *************** */ - OpFusionExecCloseIndices(result_rel_info); + ExecCloseIndices(result_rel_info); m_local.m_isCompleted = true; m_local.m_scan->End(true); ExecDoneStepInFusion(m_c_local.m_estate); diff --git a/src/gausskernel/runtime/opfusion/opfusion_insert.cpp b/src/gausskernel/runtime/opfusion/opfusion_insert.cpp index 2d2b01979..455756d79 100644 --- a/src/gausskernel/runtime/opfusion/opfusion_insert.cpp +++ b/src/gausskernel/runtime/opfusion/opfusion_insert.cpp @@ -241,7 +241,7 @@ static void ExecReleaseResource(Tuple tuple, TupleTableSlot *slot, ResultRelInfo { tableam_tops_free_tuple(tuple); (void)ExecClearTuple(slot); - OpFusionExecCloseIndices(result_rel_info); + ExecCloseIndices(result_rel_info); ExecDoneStepInFusion(estate); if (bucket_rel != NULL) { bucketCloseRelation(bucket_rel); diff --git a/src/gausskernel/runtime/opfusion/opfusion_update.cpp b/src/gausskernel/runtime/opfusion/opfusion_update.cpp index 657d81b2b..bec178d21 100644 --- a/src/gausskernel/runtime/opfusion/opfusion_update.cpp +++ b/src/gausskernel/runtime/opfusion/opfusion_update.cpp @@ -571,7 +571,7 @@ lreplace: /**************** * step 3: done * ****************/ - OpFusionExecCloseIndices(result_rel_info); + ExecCloseIndices(result_rel_info); m_local.m_isCompleted = true; m_local.m_scan->End(true); ExecDoneStepInFusion(m_c_local.m_estate); diff --git a/src/gausskernel/storage/buffer/bufmgr.cpp b/src/gausskernel/storage/buffer/bufmgr.cpp index 285172e5f..8e79236af 100644 --- a/src/gausskernel/storage/buffer/bufmgr.cpp +++ b/src/gausskernel/storage/buffer/bufmgr.cpp @@ -2032,7 +2032,11 @@ static bool ReadBuffer_common_ReadBlock(SMgrRelation smgr, char relpersistence, pgstat_count_buffer_read_time(INSTR_TIME_GET_MICROSEC(io_time)); INSTR_TIME_ADD(u_sess->instr_cxt.pg_buffer_usage->blk_read_time, io_time); pgstatCountBlocksReadTime4SessionLevel(INSTR_TIME_GET_MICROSEC(io_time)); - } + } else { + INSTR_TIME_SET_CURRENT(io_time); + INSTR_TIME_SUBTRACT(io_time, io_start); + pgstatCountBlocksReadTime4SessionLevel(INSTR_TIME_GET_MICROSEC(io_time)); + } /* check for garbage data */ if (rdStatus == SMGR_RD_CRC_ERROR) { diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h index 7f2b5828a..14ee0ad6a 100755 --- a/src/include/executor/executor.h +++ b/src/include/executor/executor.h @@ -644,7 +644,6 @@ extern Partition ExecOpenScanParitition( extern void ExecOpenIndices(ResultRelInfo* resultRelInfo, bool speculative); extern void ExecCloseIndices(ResultRelInfo* resultRelInfo); -extern void OpFusionExecCloseIndices(ResultRelInfo* resultRelInfo); extern List* ExecInsertIndexTuples( TupleTableSlot* slot, ItemPointer tupleid, EState* estate, Relation targetPartRel, Partition p, int2 bucketId, bool* conflict, Bitmapset *modifiedIdxAttrs, bool inplaceUpdated = false);