优化数据库的方法: 1、关键字段建立索引。 2、使用存储过程,它使SQL变得更加灵活和高效。 3、备份数据库和清除垃圾数据。 4、SQL语句语法的优化。(可以用Sybase的SQL Expert,可惜我没找到unexpired的序列号) 5、清理删除日志。 SQL语句优化的原则: ◆1、使用索引来更快地遍历表 缺省情况下建立的索引是非群集索引,但有时它并不是最佳的。在非群集索引下,数据在物理上随机存放在数据页上。合理的索引设计要建立在对各种查询的分析和预测上。一般来说:①.有大量重复值、且经常有范围查询(between, > , =, <!-- Baidu Button BEGIN -->
<!-- Baidu Button END --> <!--192.168.100.33-->
上一篇:
从100万个整数里找出100个最大的数
下一篇:
多线程网址
<!-- Baidu Button BEGIN --> <script type="text/javascript" id="bdshare_js" data="type=tools&uid=1536434"></script><script type="text/javascript" id="bdshell_js"></script><script type="text/javascript"> document.getElementById("bdshell_js").src = "http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion=" + Math.ceil(new Date()/3600000) </script><!-- Baidu Button END -->