Help表名则可以查看更为简略的表的结构信息。
* help li\g
Executing . . .
Name: li
Owner: ingres
Created: 04-apr-2011 22:07:47
Type: user table
Version: II10.0
Column Information:
Key
Column Name Type Length Nulls Defaults Seq
l_orderkey integer 4 no no
l_partkey integer 4 no no
l_suppkey integer 4 no no
l_linenumber integer 4 no no
l_quantity decimal(15, 2) 15 no no
l_extendedprice decimal(15, 2) 15 no no
l_discount decimal(15, 2) 15 no no
l_tax decimal(15, 2) 15 no no
l_returnflag char 1 no no
l_linestatus char 1 no no
l_shipdate ansidate no no
l_commitdate ansidate no no
l_receiptdate ansidate no no
l_shipinstruct char 25 no no
l_shipmode char 10 no no
l_comment varchar 44 no no
continue
至于更多的help选项,可以用help help\g命令查看,这里不再赘述。
四、性能测试
测试项目包含三方面,第一是加载,数据仓库要处理的数据量巨大,数据加载能力是选择数据库软件要考虑的重要因素之一,我们将测试包括外部文本数据加载和从数据库内部抽取部分数据到其他表的性能。第二是压缩,数据压缩时常被作为列式存储数据库的一个卖点来宣传,因此我们单独把它拿出来测试。由于多数数据库没有单独的表压缩命令,都是依靠参数指定是否压缩或根本无法指定不压缩(Sybase IQ),只测试压缩后的占用空间对原始外部文件的压缩率。第三是测试重点,数据查询,分别采用tpc-h scala=10,SSB (星型模式基准)scala=10以及用户真实的大规模数据作全表分组查询。
TPC-H是一个业界公认的数据仓库性能测试基准,比较公正和中立,它定义了8个标准数据库表:customer,lineitem,nation,orders,partsupp,part,region,supplier,各表之间的关系见tpc.org网站的官方文档,一个数据生成工具(dbgen)和一个查询生成工具(qgen)。此外TPC-H定义了不同的数据仓库容量(size),包括:1GB、100GB、300GB、1000GB等。dbgen工具可以通过传递不同的参数值,生成不同数据库尺寸下的表数据,非常灵活。 Qgen可以随机产生相同条件的不同取值的查询,我们这里为了简化,只取一次产生的查询语句。
SSB是麻省州立大学波士顿校区的研究人员在tpc-h模型基础上变换出来的一个数据模型,具体的描述参见http://www.cs.umb.edu/~poneil/StarSchemaB.PDF,它主要将tpc-h的雪花模型修改为星型模式,将lineitem表和orders表合并,并对一些表和数据列进行了裁减。这个模型的scala虽然沿用了tpc-h的计数方式,但实际上对于相同的scala只是记录数保持相等,而实际数据量大大缩小了,已经偏离了原来scala为几就是几GB数据的含义。
(一)数据加载
1.从外部文本文件导入
VectorWise提供了二种导入外部文件的方式,sql工具中的COPY命令和使用专用的iivwfastload工具。我们导入前先用重定向方式执行创建表的脚本。然后首先采用用户指南推荐的最快的导入方式, 用iivwfastload执行导入。命令行参数:
iivwfastload -database数据库名 -table 表名 -datafile 文本数据文件完整路径-fdelim 列分隔符 -rdelim 行分隔符,其中行列分隔符需要用一对''括起来。支持\n等转义符写法。
INGRES TERMINAL MONITOR Copyright 2010 Ingres Corporation
VectorWise Linux Version VW 1.5.0 (a64.lnx/141)NPTL login
Sun Apr3 04:18:27 2011
Enter \g to execute commands, "help help\g" for help, \q to quit
continue
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * *
* * * * * Executing . . .
continue
*
Your SQL statement(s) have been committed.
VectorWise Version VW 1.5.0 (a64.lnx/141)NPTL logout
Sun Apr3 04:18:27 2011
[ingres@redflag11012602 ~]$ date;iivwfastload -database tpch -table customer-datafile
/user1/app/vw15/customer.tbl -fdelim '|' -rdelim '\n';date
2011年 04月 03日 星期日 19:23:14 CST
/user1/app/vw15/ingres/bin/iivwfastload
Using settings:
database : 'tpch'
table : 'customer'
datafile : '/user1/app/vw15/customer.tbl'
fdelim : '|'
rdelim : '\n'
ingreschar : NO
nullvalue: ''
verifycount: YES
updatecount: YES
attrs : ''
tmpfile : /tmp/iivwfastload.tmp
Connecting to X100 server at port '44216'
Looking up table 'customer'
Analyzing the table info
Generating the loading request
Loading OK, returning 1500000
Loaded 1500000 records, verified table count OK (0 -> 1500000)
Updated catalog statistics
Goodbye
2011年 04月 03日 星期日 19:23:20 CST
[ingres@redflag11012602 ~]$ date;iivwfastload -database tpch -table lineitem-datafile
/user1/app/vw15/lineitem.tbl -fdelim '|' -rdelim '\n';date
2011年 04月 03日 星期日 19:27:17 CST
Loading OK, returning 59986052
Updated catalog statistics
Goodbye
2011年 04月 03日 星期日 19:31:17 CST
[ingres@redflag11012602 ~]$ date;iivwfastload -database tpch -table orders-datafile
/user1/app/vw15/orders.tbl -fdelim '|' -rdelim '\n';date
2011年 04月 03日 星期日 19:32:26 CST
Loading OK, returning 15000000
Updated catalog statistics
Goodbye
2011年 04月 03日 星期日 19:33:12 CST
[ingres@redflag11012602 ~]$ date;iivwfastload -database tpch -table part-datafile
/user1/app/vw15/part.tbl -fdelim '|' -rdelim '\n
';date
2011年 04月 03日 星期日 19:33:25 CST
Loading OK, returning 2000000
Updated catalog statistics
Goodbye
2011年 04月 03日 星期日 19:33:30 CST
[ingres@redflag11012602 ~]$ date;iivwfastload -database tpch -table partsupp-datafile
/user1/app/vw15/partsupp.tbl -fdelim '|' -rdelim '\n';date
2011年 04月 03日 星期日 19:34:07 CST
Loading OK, returning 8000000
Updated catalog statistics
Goodbye
2011年 04月 03日 星期日 19:34:25 CST
[ingres@redflag11012602 ~]$ date;iivwfastload -database tpch -table nation-datafile
/user1/app/vw15/nation.tbl -fdelim '|' -rdelim '\n';date
2011年 04月 03日 星期日 19:34:37 CST
Loading OK, returning 25
Updated catalog statistics
Goodbye
2011年 04月 03日 星期日 19:34:37 CST
[ingres@redflag11012602 ~]$ date;iivwfastload -database tpch -table supplier-datafile
/user1/app/vw15/supplier.tbl -fdelim '|' -rdelim '\n';date
2011年 04月 03日 星期日 19:34:53 CST
Loading OK, returning 100000
Updated catalog statistics
Goodbye
2011年 04月 03日 星期日 19:34:53 CST
[ingres@redflag11012602 ~]$ date;iivwfastload -database tpch -table region-datafile
/user1/app/vw15/region.tbl -fdelim '|' -rdelim '\n';date
2011年 04月 03日 星期日 19:35:09 CST
Loading OK, returning 5
Updated catalog statistics
Goodbye
2011年 04月 03日 星期日 19:35:09 CST
[ingres@redflag11012602 ~]$ pwd
/home/ingres