卐卍 发表于 2010-11-09 16:15

请教个临时表的问题

--select col1,col2 from table1 into temp temp1 with no log;
--select col1,col2 from table2 into temp temp1 with no log;

select a.*
from table3 a,temp1 b
where a.col1=b.col1
into temp temp2 with no log;

我有两个表都可以生成一个临时表temp1的记录
但其中一个table1生成的temp1与table3关联可以1分钟生成数据
另外一个table2生成的temp1与table3关联生成数据就要几个小时
这有可能是什么原因呢?

liaosnet 发表于 2010-11-09 21:27

那就说可能的原因好了: table2太大~:em17:

卐卍 发表于 2010-11-10 08:01

不是都差不多一个2700一个3000
不是大小的原因

卐卍 发表于 2010-11-10 15:44

生成的临时表跟table1和table2的索引有没有关系啊

yunzhongyue 发表于 2010-11-10 21:11

估计两条语句的执行计划不同!

回复 4# 卐卍

“卐卍”这两个字怎么读啊?

liaosnet 发表于 2010-11-11 00:09

估计两条语句的执行计划不同!

回复卐卍

“卐卍”这两个字怎么读啊?
yunzhongyue 发表于 2010-11-10 21:11 http://bbs3.chinaunix.net/images/common/back.gif


   两个字都是万(wan)。

卐卍 发表于 2010-11-11 08:22

执行计划不同是嘛意思啊

yunzhongyue 发表于 2010-11-11 13:59

意思是一个走索引,一个走全表扫描!
页: [1]
查看完整版本: 请教个临时表的问题