从三种角度优化:表的设计,sql优化,索引优化。 一、表的设计规约(来自阿里) 1、 1.对查询进行优化,要尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引。 2.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索引而进行全表扫 ...
分类:
数据库 时间:
2019-05-29 16:33:12
阅读次数:
136
1、应尽量避免在 where 子句中使用!=或<>操作符,否则将引擎放弃使用索引而进行全表扫描。 2、对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引。 3、应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索引 ...
分类:
数据库 时间:
2019-05-25 20:14:13
阅读次数:
148
Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and r ...
分类:
其他好文 时间:
2019-05-24 14:13:34
阅读次数:
85
线性筛中每个数只会被最小的素因子筛一次 1)线性筛素数 2)线性筛约数个数 每个数的约数个数为(a1+1)*(a2+1)*...*(ak+1),首先如果数i是素数,可以直接得到约数个数w[i]=2,又由于线性筛的时候,每个数是被最小素因子筛掉,所以如果i%prime[j]!=0,那么prime[j] ...
分类:
其他好文 时间:
2019-05-23 13:14:13
阅读次数:
146
SET @ROW_NUMBER:=0; select round(avg(LAT_N),4) from ( select @Row_Number := @Row_Number +1 as count_of_group, LAT_N , (SELECT COUNT(*) FROM Station ) ... ...
分类:
数据库 时间:
2019-05-22 23:56:14
阅读次数:
250
TP时间服务器 作用:ntp主要是用于对计算机的时间同步管理操作。 时间是对服务器来说是很重要的,一般很多网站都需要读取服务器时间来记录相关信息,如果时间不准,则可能造成很大的影响。 NTP时间服务部署 第一步:关防火墙 服务器端和客户端都要进行操作 [root@ken ~]# systemctl ...
分类:
其他好文 时间:
2019-05-22 21:02:46
阅读次数:
156
题目链接:Prime Ring Problem 思路: 类似八皇后问题,做递归处理即深搜,注意状态变化即可 代码: ...
分类:
其他好文 时间:
2019-05-19 11:45:00
阅读次数:
138
Prime Ring Problem UVA - 524 A ring is composed of n (even number) circles as shown in diagram. Put natural numbers 1,2,...,n into each circle separat ...
分类:
其他好文 时间:
2019-05-19 09:35:21
阅读次数:
103
Calculate a + b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less t ...
分类:
其他好文 时间:
2019-05-18 23:59:12
阅读次数:
361
//欧拉函数 小于等于 n 且与n互质的正整数个数 #include using namespace std; const int N = 100001; int n,p; int prime[N],phi[N],mark[N]; int main(){ cin >> n; phi[1] = 1; ... ...
分类:
其他好文 时间:
2019-05-18 09:36:38
阅读次数:
109