slimit1.sim 1.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 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 56 57 58 59 60 61 62 63 64 65 66 67
system sh/stop_dnodes.sh

system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2
system sh/exec.sh -n dnode1 -s start
sleep 100
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
sql create database $db maxrows 200
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
  
run general/parser/slimit1_query.sim

print ================== restart server to commit data into disk
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 500
system sh/exec.sh -n dnode1 -s start
print ================== server restart completed
sql connect
sleep 100

run general/parser/slimit1_query.sim

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