Skip to content

Commit

Permalink
modified TestParallelQueryIssue. insertion has paralaized. buffer poo…
Browse files Browse the repository at this point in the history
…l size is changed to 5GB. and disabled checkpoint/update statistics thread for perfomance evaluation.
  • Loading branch information
ryogrid committed Oct 9, 2023
1 parent 5774a6c commit 5201df5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion common/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var LogTimeout time.Duration
const EnableDebug bool = false //true

// use virtual storage or not
const EnableOnMemStorage = true
const EnableOnMemStorage = false //true

// when this is true, virtual storage use is suppressed
// for test case which can't work with virtual storage
Expand Down
4 changes: 2 additions & 2 deletions samehada/samehada.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@ func NewSamehadaDB(dbName string, memKBytes int) *SamehadaDB {

//chkpntMgr := concurrency.NewCheckpointManager(shi.GetTransactionManager(), shi.GetLogManager(), shi.GetBufferPoolManager())
//chkpntMgr.StartCheckpointTh()
shi.GetCheckpointManager().StartCheckpointTh()
//shi.GetCheckpointManager().StartCheckpointTh()

// statics data is updated periodically by this thread with full scan of all tables
// this may be not good implementation of statistics, but it is enough for now...
statUpdater := concurrency.NewStatisticsUpdater(shi.GetTransactionManager(), c)
statUpdater.StartStaticsUpdaterTh()
//statUpdater.StartStaticsUpdaterTh()

return &SamehadaDB{shi, c, exec_engine, statUpdater}
}
Expand Down
15 changes: 11 additions & 4 deletions samehada/samehada_test/samehada_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ func TestParallelQueryIssue(t *testing.T) {
os.Remove(t.Name() + ".log")
}

db := samehada.NewSamehadaDB(t.Name(), 5000) // 5MB
opTimes := 100000
db := samehada.NewSamehadaDB(t.Name(), 5000*1000) //5GB // 5MB
opTimes := 100000 //500000 //1000000

queryVals := make([]int32, 0)

Expand All @@ -350,9 +350,16 @@ func TestParallelQueryIssue(t *testing.T) {
err, _ := db.ExecuteSQL("CREATE TABLE k_v_list(k INT, v INT);")
testingpkg.Assert(t, err == nil, "failed to create table")

insCh := make(chan int32)
for ii := 0; ii < opTimes; ii++ {
err, _ = db.ExecuteSQLRetValues(fmt.Sprintf("INSERT INTO k_v_list(k, v) VALUES (%d, %d);", queryVals[ii], queryVals[ii]))
testingpkg.Assert(t, err == nil, "failed to insert val: "+strconv.Itoa(int(queryVals[ii])))
go func(val int32) {
err, _ = db.ExecuteSQLRetValues(fmt.Sprintf("INSERT INTO k_v_list(k, v) VALUES (%d, %d);", val, val))
insCh <- val
}(queryVals[ii])
//testingpkg.Assert(t, err == nil, "failed to insert val: "+strconv.Itoa(int(queryVals[ii])))
}
for ii := 0; ii < opTimes; ii++ {
<-insCh
}

// shuffle query vals array elements
Expand Down

0 comments on commit 5201df5

Please sign in to comment.