Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ryogrid committed Sep 8, 2024
1 parent 0d752d3 commit 039f042
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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!")
}
Expand Down
2 changes: 1 addition & 1 deletion lib/samehada/samehada_util/samehada_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
8 changes: 4 additions & 4 deletions lib/storage/index/btree_index.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand All @@ -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
}
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 039f042

Please sign in to comment.