informix操作临时表缓慢

通过ec程序,第一次创建临时表,查询临时表,非常慢。等到第二次执行的时候就非常快。score--->数据量在360万左右info columns for score id                            serials...显示全部
通过ec程序,第一次创建临时表,查询临时表,非常慢。等到第二次执行的时候就非常快。
score--->数据量在360万左右
info columns for score

id                            serial
stuid                       char(11)
cid                           char(11)
score                       int
grade                       char(11)
comments                 char(110)
desc                          char(1)
date                           date


select * from score where id <70000 into temp scoretmp with no log;

select * from scoretmp a where exists (
select * from score where a.stuid = stuid and cid<1000);

time dbaccess db 1.sql

持续时间约为2min

第二次的时候 2s

重启数据库后第一次又是2min


通过不同的环境测试,都是第一次很慢,第二次就非常快


现在考虑是 第一次执行后数据被缓存到BUFFER POOL 中,所以第二次过来执行直接去BUFFER POOL 中读数据,
可是如何优化第一次执行的时间呢?收起
参与8

查看其它 7 个回答lzblong的回答

lzblonglzblong软件开发工程师xxxx
临时表建索引,做统计更新
互联网服务 · 2013-04-19
浏览1402

回答者

lzblong
软件开发工程师xxxx

lzblong 最近回答过的问题

回答状态

  • 发布时间:2013-04-19
  • 关注会员:0 人
  • 回答浏览:1402
  • X社区推广