一、合理使用索引
使用原则:
1、经常在查询中作为条件被使用的列,应为其建立索引。
2、频繁进行排序或分组group by 或 order by 操作的列,应为其建立索引。
3、一个列值域很大时,应为其建立索引。
4、如果待排序的列有多个,应在这些列上建立符合索引。
5、参与了连接操作的属性
6、在某一范围内频繁搜索的属性和按照排序顺序平凡检索的属性
7、在where子句中包含的一个关系的多个属性,可以考虑在这些属性上建立多属性索引。
此外,如果数据库文件需要频繁执行精确匹配查询(如等值查询),可考虑建立散...
分类:
数据库 时间:
2014-09-19 22:36:36
阅读次数:
322
1.根据ROWID来分select * from t_xiaoxi where rowid in(select rid from (select rownum rn,rid from(select rowid rid,cid fromt_xiaoxi order by cid desc) wher....
分类:
数据库 时间:
2014-09-19 15:13:55
阅读次数:
183
【题目简述】:其实就是根据题目描述:A permutation of the integers 1 to n is an ordering of these integers. So the natural way to represent a permutation is to list the integers in this order. With n = 5, a permutation...
分类:
其他好文 时间:
2014-09-19 13:53:15
阅读次数:
185
一:根据用户的得分查询其排名答:先查出分数比当前用户高的有几个,在查出积分跟当前用户相等,时间早于这个用户的有几个,相加就是排名或set @i = 0;SELECT *, (@i := @i + 1) AS ranking from user_score order by score desc, c...
分类:
数据库 时间:
2014-09-19 13:44:35
阅读次数:
231
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, ...
分类:
其他好文 时间:
2014-09-19 13:43:05
阅读次数:
194
在窗口与窗口之间毫无重叠的情况下,根本不需要关心z-order。然而,当窗口之间出现重叠时,系统就需要通过一个标准来确定窗口的显示顺序。这个标准就是z-order。存在多个因素影响一个窗口的z-order:
1、窗口类型是否为TOPMOST;
2、窗口间的父子...
分类:
其他好文 时间:
2014-09-19 13:31:45
阅读次数:
154
select HSL.sortno, HSL.B, HSL.A, row_number() over(order by sortno desc) xh from (select t.B, t.A, case when t.B= '股份公司' then 9999999 else t.A end as....
分类:
数据库 时间:
2014-09-18 18:10:24
阅读次数:
216
[leetcode]Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we will use the integers 0, 1, and 2 to represent the color red, white, and...
分类:
其他好文 时间:
2014-09-18 13:21:43
阅读次数:
164
引自:http://blog.sina.com.cn/s/blog_7c0e26230100x2zl.html1.获取所有数据库名:SELECT Name from Master..SysDatabases ORDER BY Name2.获取所有表名:SELECT Name from Databas...
分类:
数据库 时间:
2014-09-18 12:54:23
阅读次数:
221
A method and apparatus for executing lock instructions speculatively in an out-of-order processor are disclosed. In one embodiment, a prediction is ma...
分类:
移动开发 时间:
2014-09-18 01:57:13
阅读次数:
283