你的查询中是否使用了row_id ?

解决方案 »

  1.   

    INDEX在小型表上无多大区别的。
      

  2.   

    row_id是唯一的吗??建的是什么索引?clustered??查询中是否使用了row_id ?
      

  3.   

    row_id是唯一索引,建的是默认的索引,
    我检索时用
    select * from book
    select row_id from book 两句 来检测索引
      

  4.   

    不会吧,一百万的数据select * from book 和select row_id from book 应该不一样的,不解ing....
      

  5.   

    测试过程:环境:
    PIII900 128M
    win2000+sql server2000企业版
    table name :t_data
    CLUSTERED PRIMARY KEY  :id
    Rows:441000语句1:
    select * from t_data where 
    id in
    (select top 10 id  from t_data where id in
    (select top 60000 id  from t_data order by id asc)
    order by id desc)
    order by id asc时间:390ms语句2:
    select * from t_data where 
    id in
    (select top 10 id  from t_data where id in
    (select top 100000 id  from t_data order by id asc)
    order by id desc)
    order by id asc时间:4s语句3:
    select * from t_data where 
    id in
    (select top 10 id  from t_data where id in
    (select top 150000 id  from t_data order by id asc)
    order by id desc)
    order by id asc时间:5s语句4:
    select * from t_data where 
    id in
    (select top 10 id  from t_data where id in
    (select top 200000 id  from t_data order by id asc)
    order by id desc)
    order by id asc时间:6s语句5:
    select * from t_data where 
    id in
    (select top 10 id  from t_data where id in
    (select top 250000 id  from t_data order by id asc)
    order by id desc)
    order by id asc时间:过了15m没有出来,中断语句6:
    select * from t_data where 
    id in
    (select top 10 id  from t_data where id in
    (select top 300000 id  from t_data order by id asc)
    order by id desc)
    order by id asc时间:过了20m没有出来,中断语句7:
    select top 60000 id  into #a from t_data order by id asccreate index ind_a_base_id on #a(id)  select * from t_data where 
    id in (select top 10 id  from #a order by id desc)
    order by id asc时间:20s语句8:
    select top 100000 id  into #a from t_data order by id asccreate index ind_a_base_id on #a(id)  select * from t_data where 
    id in (select top 10 id  from #a order by id desc)
    order by id asc时间:21s语句9:
    select top 150000 id  into #a from t_data order by id asccreate index ind_a_base_id on #a(id)  select * from t_data where 
    id in (select top 10 id  from #a order by id desc)
    order by id asc时间:23s语句10:
    select top 200000 id  into #a from t_data order by id asccreate index ind_a_base_id on #a(id)  select * from t_data where 
    id in (select top 10 id  from #a order by id desc)
    order by id asc时间:24s语句11:
    select top 250000 id  into #a from t_data order by id asccreate index ind_a_base_id on #a(id)  select * from t_data where 
    id in (select top 10 id  from #a order by id desc)
    order by id asc时间:26s语句12:
    select top 300000 id  into #a from t_data order by id asccreate index ind_a_base_id on #a(id)  select * from t_data where 
    id in (select top 10 id  from #a order by id desc)
    order by id asc时间:28s语句13:
    select top 400000 id  into #a from t_data order by id asccreate index ind_a_base_id on #a(id)  select * from t_data where 
    id in (select top 10 id  from #a order by id desc)
    order by id asc时间:29s语句14:
    select * from t_data where 
    id in
    (select top 10 id  from t_data where id in
    (select top 250000 id  from t_data order by id asc)
    order by id desc)
    order by id asc时间:过了25m没有出来,还没有中断