第六组
(1) select count(1) from table;
(2) select count(*) from table;
(3) select count(fieldA) from table;
(4) select count(rowid) from table;

解决方案 »

  1.   

    第一组
    (1) select * from table where field_1 like 'abcd%'
    (2) select * from table where SUBSTR(field_1,1,4) = 'abcd'
    可以对(2)作一个函数索引
    第二组
    (1) select * from table where field_1 NOT > 5
    (2) select * from table where field_1  <=   5
    (1)是什么句法?
    第三组
    (2)可取第四组
    根据Oracle优化路径
    rule 模式下的规则:1、有两个索引存在的情况下,from后面大表在前。小表(返回记录少的表,不是记录少的表)在最后,作为驱动表,Oracle处理SQL语句是从左到右2、有一个索引,则顺序无关3、都没有索引,则大表应该在后第五组
    (1) select A.* from A, B where A.field1 =b.field1
      

  2.   

    基本同意bobo
    关于6,最高效的还是select (primary key|unique key) from tablename
      

  3.   

    写错
    select count(primary key|unique key) from tablename