slimit.sim 2.8 KB
Newer Older
S
slguan 已提交
1
system sh/stop_dnodes.sh
S
slguan 已提交
2 3

system sh/deploy.sh -n dnode1 -i 1
H
hjxilinx 已提交
4
system sh/cfg.sh -n dnode1 -c walLevel -v 0
S
scripts  
slguan 已提交
5
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
S
slguan 已提交
6
system sh/exec.sh -n dnode1 -s start
H
Haojun Liao 已提交
7
sleep 500
S
slguan 已提交
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
sql connect

$dbPrefix = slm_db
$tbPrefix = slm_tb
$stbPrefix = slm_stb
$tbNum = 10
$rowNum = 300
$totalNum = $tbNum * $rowNum
$ts0 = 1537146000000
$delta = 600000
print ========== slimit.sim
$i = 0
$db = $dbPrefix . $i
$stb = $stbPrefix . $i

sql drop database if exists $db
H
Haojun Liao 已提交
24
sql create database $db maxrows 200 cache 16
S
slguan 已提交
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
print ====== create tables
sql use $db
sql create table $stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 smallint, c6 tinyint, c7 bool, c8 binary(10), c9 nchar(10)) tags(t1 binary(15), t2 int, t3 bigint, t4 nchar(10), t5 double, t6 bool)

$i = 0
$ts = $ts0
$halfNum = $tbNum / 2
while $i < $tbNum
  $tb = $tbPrefix . $i
  $t1 = ' . $tb
  $t1 = $t1 . '
  $t2 = $i
  $t3 = $i
  $t4 = '涛思 . $tb
  $t4 = $t4 . '
  $t5 = $i
  $t6 = true
  sql create table $tb using $stb tags( $t1 , $t2 , $t3 , $t4 , $t5 , $t6 )
 
  $x = 0
  while $x < $rowNum
    $xs = $x * $delta
    $ts = $ts0 + $xs
    $c = $x / 10
    $c = $c * 10
    $c = $x - $c
    $binary = 'binary . $c 
    $binary = $binary . '
    $nchar = '涛思nchar . $c
    $nchar = $nchar . '
    sql insert into $tb values ( $ts , $c , $c , $c , $c , $c , $c , true, $binary , $nchar ) 
    $x = $x + 1
  endw 
  $ts = $ts + $delta
59
  sql insert into $tb values ( $ts , NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL )
S
slguan 已提交
60 61 62 63 64 65
  $i = $i + 1
endw
print ====== $db tables created

$db = $dbPrefix . 1
sql drop database if exists $db
H
Haojun Liao 已提交
66
sql create database $db maxrows 200 cache 16
S
slguan 已提交
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
sql use $db
sql create table $stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 smallint, c6 tinyint, c7 bool, c8 binary(10), c9 nchar(10)) tags(t1 binary(15), t2 int, t3 bigint, t4 nchar(10), t5 double, t6 bool)

$i = 0
$ts = $ts0
$halfNum = $tbNum / 2
while $i < $tbNum
  $tb = $tbPrefix . $i                                                                                                                           
  $t1 = ' . $tb
  $t1 = $t1 . '
  $t2 = $i
  $t3 = $i
  $t4 = '涛思 . $tb
  $t4 = $t4 . '
  $t5 = $i
  $t6 = true
  sql create table $tb using $stb tags( $t1 , $t2 , $t3 , $t4 , $t5 , $t6 )
 
  $x = 0
  while $x < $rowNum
    $xs = $x * $delta
    $ts = $ts0 + $xs
89
    sql insert into $tb values ( $ts , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL ) 
S
slguan 已提交
90 91 92 93 94 95
    $x = $x + 1
  endw 
  $i = $i + 1
endw
print ====== $db tables created
  
S
scripts  
slguan 已提交
96
run general/parser/slimit_query.sim
S
slguan 已提交
97 98 99

print ================== restart server to commit data into disk
system sh/exec.sh -n dnode1 -s stop -x SIGINT
H
Haojun Liao 已提交
100
sleep 3000
S
slguan 已提交
101 102 103
system sh/exec.sh -n dnode1 -s start
print ================== server restart completed
sql connect
H
Haojun Liao 已提交
104
sleep 500
S
slguan 已提交
105

S
scripts  
slguan 已提交
106
run general/parser/slimit_query.sim
S
scripts  
Shengliang Guan 已提交
107 108

system sh/exec.sh -n dnode1 -s stop -x SIGINT