diff --git a/common/config.go b/common/config.go index 15818b8a..d5036409 100644 --- a/common/config.go +++ b/common/config.go @@ -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 diff --git a/samehada/samehada.go b/samehada/samehada.go index 37d159fc..e77195ab 100644 --- a/samehada/samehada.go +++ b/samehada/samehada.go @@ -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} } diff --git a/samehada/samehada_test/samehada_test.go b/samehada/samehada_test/samehada_test.go index 7eda5214..46d0631e 100644 --- a/samehada/samehada_test/samehada_test.go +++ b/samehada/samehada_test/samehada_test.go @@ -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) @@ -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