diff --git a/lib/execution/executors/executor_test/btree_index_executor_test.go b/lib/execution/executors/executor_test/btree_index_executor_test.go index d42cef5c..51832e87 100644 --- a/lib/execution/executors/executor_test/btree_index_executor_test.go +++ b/lib/execution/executors/executor_test/btree_index_executor_test.go @@ -127,9 +127,9 @@ func testBTreeParallelTxnStrideRoot[T int32 | float32 | string](t *testing.T, ke //InnerTestParallelTxnsQueryingIndexUsedColumns[T](t, keyType, 800, 30000, 13, 0, bpoolSize, index_constants.INDEX_KIND_BTREE, PARALLEL_EXEC, 20) - //InnerTestParallelTxnsQueryingIndexUsedColumns[T](t, keyType, 800, 1000, 13, 0, bpoolSize, index_constants.INDEX_KIND_BTREE, SERIAL_EXEC, 1) + //InnerTestParallelTxnsQueryingIndexUsedColumns[T](t, keyType, 800, 3000, 13, 0, bpoolSize, index_constants.INDEX_KIND_BTREE, SERIAL_EXEC, 1) - InnerTestParallelTxnsQueryingIndexUsedColumns[T](t, keyType, 800, 3000, 13, 0, bpoolSize, index_constants.INDEX_KIND_BTREE, PARALLEL_EXEC, 20) + InnerTestParallelTxnsQueryingIndexUsedColumns[T](t, keyType, 800, 30000, 13, 0, bpoolSize, index_constants.INDEX_KIND_BTREE, PARALLEL_EXEC, 20) case types.Float: InnerTestParallelTxnsQueryingIndexUsedColumns[T](t, keyType, 240, 1000, 13, 0, bpoolSize, index_constants.INDEX_KIND_BTREE, PARALLEL_EXEC, 20) case types.Varchar: @@ -138,8 +138,8 @@ func testBTreeParallelTxnStrideRoot[T int32 | float32 | string](t *testing.T, ke //InnerTestParallelTxnsQueryingIndexUsedColumns[T](t, keyType, 400, 1000, 17, 0, bpoolSize, index_constants.INDEX_KIND_BTREE, SERIAL_EXEC, 1) //InnerTestParallelTxnsQueryingIndexUsedColumns[T](t, keyType, 800, 5000, 17, 0, bpoolSize, index_constants.INDEX_KIND_BTREE, SERIAL_EXEC, 1) - //InnerTestParallelTxnsQueryingIndexUsedColumns[T](t, keyType, 800, 3000, 17, 0, bpoolSize, index_constants.INDEX_KIND_BTREE, SERIAL_EXEC, 1) - InnerTestParallelTxnsQueryingIndexUsedColumns[T](t, keyType, 800, 3000, 17, 0, bpoolSize, index_constants.INDEX_KIND_BTREE, PARALLEL_EXEC, 20) + InnerTestParallelTxnsQueryingIndexUsedColumns[T](t, keyType, 800, 3000, 17, 0, bpoolSize, index_constants.INDEX_KIND_BTREE, SERIAL_EXEC, 1) + //InnerTestParallelTxnsQueryingIndexUsedColumns[T](t, keyType, 800, 3000, 17, 0, bpoolSize, index_constants.INDEX_KIND_BTREE, PARALLEL_EXEC, 20) default: panic("not implemented!") } diff --git a/lib/samehada/samehada_util/samehada_util.go b/lib/samehada/samehada_util/samehada_util.go index 3aa43e97..21a05dce 100644 --- a/lib/samehada/samehada_util/samehada_util.go +++ b/lib/samehada/samehada_util/samehada_util.go @@ -180,7 +180,7 @@ func GetRandomPrimitiveVal[T int32 | float32 | string](keyType types.TypeID, max // TODO: (SDB) FOR DEBUG: length is fixed //var ret interface{} = *GetRandomStr(50, false) //var ret interface{} = *GetRandomStr(50, true) - var ret interface{} = *GetRandomStr(50, false) + var ret interface{} = *GetRandomStr(50, true) return ret.(T) default: panic("not supported keyType") diff --git a/lib/storage/index/btree_index.go b/lib/storage/index/btree_index.go index c9328352..9f63ad42 100644 --- a/lib/storage/index/btree_index.go +++ b/lib/storage/index/btree_index.go @@ -140,7 +140,7 @@ func (btidx *BTreeIndex) ScanKey(key *tuple.Tuple, txn interface{}) []page.RID { smallestKeyVal := samehada_util.EncodeValueAndRIDToDicOrderComparableVarchar(&orgKeyVal, &page.RID{0, 0}) biggestKeyVal := samehada_util.EncodeValueAndRIDToDicOrderComparableVarchar(&orgKeyVal, &page.RID{math.MaxInt32, math.MaxUint32}) - //btidx.rwMtx.RLock() + btidx.rwMtx.RLock() // Attention: returned itr's containing keys are string type Value which is constructed with byte arr of concatenated original key and value rangeItr := btidx.container.GetRangeItr(smallestKeyVal.SerializeOnlyVal(), biggestKeyVal.SerializeOnlyVal()) @@ -152,7 +152,7 @@ func (btidx *BTreeIndex) ScanKey(key *tuple.Tuple, txn interface{}) []page.RID { //uintRID := binary.BigEndian.Uint64(eightBytesRID[:]) retArr = append(retArr, samehada_util.Unpack8BytesToRID(eightBytesRID[:])) } - //btidx.rwMtx.RUnlock() + btidx.rwMtx.RUnlock() return retArr } @@ -182,8 +182,8 @@ func (btidx *BTreeIndex) GetRangeScanIterator(start_key *tuple.Tuple, end_key *t biggestKeyVal = samehada_util.EncodeValueAndRIDToDicOrderComparableVarchar(&orgEndKeyVal, &page.RID{math.MaxInt32, math.MaxUint32}) } - //btidx.rwMtx.RLock() - //defer btidx.rwMtx.RUnlock() + btidx.rwMtx.RLock() + defer btidx.rwMtx.RUnlock() var smalledKeyBytes []byte var biggestKeyBytes []byte