slimit1.sim 1.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 2
S
slguan 已提交
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 10
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect

$dbPrefix = slm_alt_tg_db

print ========== slimit_alter_tag.sim
# make sure the data in each table crosses a file block boundary
$rowNum = 300
$ts0 = 1537146000000
$delta = 600000
$db = $dbPrefix

sql drop database if exists $db
sangshuduo's avatar
sangshuduo 已提交
21
sql create database $db maxrows 200
S
slguan 已提交
22 23 24 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
sql use $db

sql create table stb (ts timestamp, c1 int, c2 bigint, c3 double) tags(t1 int, t2 int)
# If grouped by t2, some groups should have tables from different vnodes
sql create table tb0 using stb tags (0, 0)
sql create table tb1 using stb tags (1, 0)
sql create table tb2 using stb tags (2, 0)
sql create table tb3 using stb tags (3, 1)
sql create table tb4 using stb tags (4, 1)
sql create table tb5 using stb tags (5, 1)
sql create table tb6 using stb tags (6, 2)
sql create table tb7 using stb tags (7, 2)
sql create table tb8 using stb tags (8, 2)
# tb9 is intentionally set the same tags with tb8
sql create table tb9 using stb tags (8, 2)

$i = 0
$tbNum = 10
while $i < $tbNum
  $tb = tb . $i
  $x = 0
  while $x < $rowNum
    $xs = $x * $delta
    $ts = $ts0 + $xs
    $c1 = $x * 10
    $c1 = $c1 + $i
    sql insert into $tb values ( $ts , $c1 , $c1 , $c1 )
    $x = $x + 1
  endw
  $i = $i + 1
endw

print ================== tables and data created
  
S
scripts  
slguan 已提交
56
run general/parser/slimit1_query.sim
S
slguan 已提交
57 58 59

print ================== restart server to commit data into disk
system sh/exec.sh -n dnode1 -s stop -x SIGINT
S
scripts  
Shengliang Guan 已提交
60
sleep 5000
S
slguan 已提交
61 62 63 64 65
system sh/exec.sh -n dnode1 -s start
print ================== server restart completed
sql connect
sleep 3000

S
scripts  
slguan 已提交
66
run general/parser/slimit1_query.sim
S
scripts  
Shengliang Guan 已提交
67 68

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