| 网站首页 | JAVA文章 | AppServers | Web开发 | 应用开发 | 资源下载 |
    想学好编程,外语很重要,最新的编程技术还是在国外  [enadd  2006年12月25日]        
设为首页 加入收藏 联系站长
您现在的位置: 编程笔记网 >> 数据库 >> Infomix >> 文章正文
Informix 高级培训教材(三)            【字体:
Informix 高级培训教材(三)
作者:未知    文章来源:未知    点击数:    更新时间:2006-11-4

and acc_book_code = t_acc_book_code
and center_code = "000000" 
and item_code = t_item_code 
and direction_idx = t_dir_idx_val1 
and direction_other = t_dir_oth_val1); 
SQL 语句中,where 条件中有or 的语句,where 条件尽量用大组合,而不要用小组合。
 

3.7. 
关于使用put , execute 来代替insert 提高效率在做数据转换或登录大批量数据时,用put execute 替代insert ,将使效率大幅度提高。因为在循环体内,减少了对insert 的语法检查及预处理的时间。
 
Put 的用法如下:

let t_pre_1 = "insert into rta1 value"
"(?,?,?,?,?,?,?,?,?,?,"
"?,?,?,?,?,?,?,?,?,?,"
"?,?,?,?,?,?,?,?,?,?,"
"?,?,?,?,?,?,?,?,?,?,"
"?,?,?,?)" 
prepare pre_rta1_1 from t_pre_1
declare cur_ins_1 cursor for pre_rta1_1 
open cur_ins_1
循环体(while , for , foreach) 

put cur_ins_1 from p_rta1.* 

close cur_ins_1 
execute 
的语法如下:
 
let t_pre_1 = "insert into rta1 value"
"(?,?,?,?,?,?,?,?,?,?,"
"?,?,?,?,?,?,?,?,?,?,"
"?,?,?,?,?,?,?,?,?,?,"
"?,?,?,?,?,?,?,?,?,?,"
"?,?,?,?)" 
prepare pre_rta1_1 from t_pre_1 
循环体
(while , for , foreach)

execute pre_rta1_1 using p_rta1.* 

使用put 必须注意以下内容:

u put 
语句必须在事物中。 
u put 语句执行完后,马上从库中select 不一定能取到数

3.8. 
使用隔离级别(isolation 
共有四种隔离级别
 
Dirty read 
Commited read 
Cursor stability 
Repeatable read 
<
> dirty read 
可能读到未提交(commited)的记录,可能读到最后被回滚的记录,该记录是一个phantom 在一些查询中,使用此隔离级别,可提高效率。因为不受其他进程锁表,锁记录的影响。
 

<
> committed read
读到的数据均为提交后的数据。两个进程可同时update 同一条记录。(缺省的隔离级别
)
<
> cursor stability 
当隔离级别设置为cursor stability 时,在某一游标内,当前记录不能被其他

的进程update,delete ,但游标内其他的记录可被其他进程update ,delete 
<> repeatable read 
当隔离级别设置为repeatable read 时,在某一游标内有两种情况

1
 该游标的where 子句有索引,则满足条件的所有记录均不能被其他进程 
update ,delete 
(该索引的搜索树的所有节点)

2
 该游标的where 子句不在索引上,则该表的所有记录均不能被其他进程 update,delete 
所以,当使用repeatable read 时,最好有索引,否则相当于锁表,极大损害系统效率。 
3.9. 
使用优化器(update statistics

对表,存储过程的优化的语法如下: 
update statistics [low ] for procedure .. 
[ medium] for table tablename [colname] resolution percent . conf 
[high ]
优化使系统表的信息与实际一致,使搜索树的路径最优。
 
同时,整理索引树。

例: 
1. update statistics for table 
2. update statistics for procedure 
3. update statistics for table rta1(bm_cert)
4. update statistics high for table rta1(bm_cert) resolution 0.5

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] 下一页  

文章录入:enadd    责任编辑:enadd 
  • 上一篇文章:

  • 下一篇文章:
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    最新热点 最新推荐 相关文章
  • 几个重要的Informix动态服务…

  • Informix 4GL 語句 memo

  • Informix 5.0 for OpenServe…

  • Informix数据仓库解决方案

  • 如何监视infomirx动态服务器

  • Informix数据仓库技术

  • Informix知识集锦1

  • informix基础知识:关于物理…

  • INFORMIX安装

  • Linux+Informix后台数据库系…

  •   网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    | 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 | 管理登录 |