将查询很慢的数据插入新的表 的问题

将查询很慢的数据插入新的表 的问题


环境: 1、A表(id,a) ,B视图(id,a)  , C表(id,a)
            2、select * from B where B=' 确定的值' ,查询速度可以接受。
            3、select * from B where B.id  in (select  id from A) ,查询速度很慢,不可以接受。
            4、select  id from A 查询速度很快。
            5、B视图 是复杂的多表连接。

   目的:   将环境中 3  的结果插入C表。但是希望实现的方法能都快。
           希望大家帮忙!!!
我也来说两句 查看全部回复

最新回复

  • liuhz2002 (2008-11-07 16:52:41)

    insert into c select B.* from B,A where B.id=A.id;
    这样应该会快一些
  • zzWind (2008-11-07 18:10:29)

    select * from B, a  where B.id=a.id