#!/bin/bash

RASQL='rasql --user rasadmin --passwd rasadmin'

COLL=test3d_1GB
TYPE=GreySet3

if [ -n "$1" ]; then
 $RASQL -q "drop collection $COLL" > /dev/null 2>&1
 $RASQL -q "create collection $COLL $TYPE" > /dev/null

 echo "inserting 1GB data..."
 $RASQL -q "insert into $COLL values marray x in [0:32767, 0:32767, 0:0] values 123c TILING ALIGNED [0:5000, 0:2000, 0:*] TILE SIZE 41943040" > /dev/null
fi

echo "selecting 1GB data..."
time $RASQL -q "select c[*:*,*:*,0] from $COLL as c" --out file --quiet
