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 7c8ecfe59..02512b712 100644 --- a/src/gausskernel/runtime/opfusion/opfusion_delete.cpp +++ b/src/gausskernel/runtime/opfusion/opfusion_delete.cpp @@ -285,7 +285,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);