Oracle tuning

  1. 使用绑定变量
  2. not in
    使用 left join+is null 代替
  3. 清除表:truncate 优于 delete,但 truncate 属于dll故无法回滚
  4. 小心隐式数据类型转换导致无法使用索引
  5. 索引字段不应该是经常更新的字段,因为字段在更新后,该字段的索引旧值不会被删除,所以会造成索引膨胀
  6. 尽可能在内层循环中减少数据集
  7. 存在性的判断根本无需进行整体的count(*)判断:select count(*) from table1
    where begintime >=trunc(sysdate-1) and rownum<2;
  8. union all 优于 union:union 排序去重
  • Highest Rated

  • My PicasaPhotos

    IMG_0641.JPG

    IMG_0665.JPG

    IMG_0576.JPG

  • RSS My del.icio.us

  • My RSS