发表于: 2008.01.02 17:08
分类: Timesten 内存数据库
出处: http://logzgh.itpub.net/post/3185/448919
---------------------------------------------------------------
ttisql就像oracle db里面的sqlplus一样。
下面是我整理的一些常用的技巧。
在ttisql里面如何重复执行上一条SQL?
答:输入!
在ttisql里面如何显示历史命令?
答:输入h;
显示data store的信息:
1.desc 显示表,存储过程的信息
2.dssize; 显示permsize和tempsize的使用情况
3.cachegroups; 显示cache group的属性
4.monitor; 显示data store当前的一些信息
如何显示或修改属性?
答: show passthrough
Command> autocommit=0;
Command> set passthrough 1;
如何查看执行计划?
答:
Command> showplan;
Command> SELECT * FROM T1, T2, T3 WHERE A=B AND B=C AND A=B;
ttisql调优的命令
• setjoinorder - Sets the join order.
• setuseindex - Sets the index hint.
• tryhash - Enables or disables the use of hash indexes.
• trymergejoin - Enables or disables merge joins.
• trynestedloopjoin - Enables or disables nested loop joins.
• tryserial - Enables or disables serial scans.
• trytmphash - Enables or disables the use of temporary hash indexes.
• trytmptable - Enables or disables the use of an intermediate results table.
• trytmpttree - Enables or disables the use of temporary ttree indexes.
• tryttree - Enables or disables the use of ttree indexes.
• tryrowid - Enables or disables the use of rowid scans.
• trytbllocks - Enables or disables the use of table locks.
• unsetjoinorder - Clears the join order.
• unsetuseindex - Clears the index hint.
如何查看sql语句执行时间?
答:
Command> timing 1;
Command> verbosity 0;











