Skip to content

Commit 7685146

Browse files
committed
update mysql.md
1 parent 57168c2 commit 7685146

3 files changed

Lines changed: 78 additions & 5 deletions

File tree

architecture/mysql.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,10 @@ EXPLAIN 中的很多额外的信息会在 Extra 字段显示,常见的有以
324324
325325
查询有使用临时表,一般出现于排序,分组和多表 join 的情况,查询效率不高,建议优化。
326326
327+
- Using where
328+
329+
列数据是从仅仅使用了索引中的信息而没有读取实际的行动的表返回的,这发生在对表的全部的请求列都是同一个索引的部分的时候,表示 MySQL 服务器将在存储引擎检索行后再进行过滤。
330+
327331
328332
## 锁总结
329333
锁是计算机协调多个进程或线程并发访问某一资源的机制。锁保证数据并发访问的一致性、有效性;锁冲突也是影响数据库并发访问性能的一个重要因素。锁是 MySQL 在服务器层和存储引擎层的并发控制。

test/src/main/java/Test.java

Lines changed: 67 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,79 @@
1-
import java.util.HashMap;
2-
import java.util.Iterator;
3-
import java.util.Map;
1+
import com.google.gson.Gson;
2+
3+
import java.util.*;
4+
import java.util.stream.IntStream;
45

56
/**
67
* @author TommyYang on 2019-04-12
78
*/
89
public class Test {
910

10-
public static void main(String[] args){
11-
testDelItemFromMap();
11+
public static void main(String[] args) throws InterruptedException {
12+
// testDelItemFromMap();
13+
14+
List<Integer> aList = new ArrayList<>(1000);
15+
IntStream.range(0, 999).forEach(index -> aList.add(index));
16+
Set<Integer> res = new HashSet<>();
17+
aList.parallelStream().forEach(i -> res.add(i));
18+
aList.parallelStream().forEach(i -> res.add(i));
19+
20+
System.out.println(res.size());
1221
}
1322

1423

24+
static class B {
25+
private int id;
26+
private boolean inWhiteList;
27+
28+
public B(int id) {
29+
this.id = id;
30+
}
31+
32+
public int getId() {
33+
return id;
34+
}
35+
36+
public void setId(int id) {
37+
this.id = id;
38+
}
39+
40+
public boolean isInWhiteList() {
41+
return inWhiteList;
42+
}
43+
44+
public void setInWhiteList(boolean inWhiteList) {
45+
this.inWhiteList = inWhiteList;
46+
}
47+
48+
@Override
49+
public String toString() {
50+
return "B{" +
51+
"id=" + id +
52+
", inWhiteList=" + inWhiteList +
53+
'}';
54+
}
55+
}
56+
57+
static class A {
58+
private Integer customerId;
59+
60+
private Integer shopId;
61+
62+
private Integer moduleId;
63+
64+
private Date beginTime;
65+
66+
private Date endTime;
67+
68+
public A(Integer customerId, Integer shopId, Integer moduleId, Date beginTime, Date endTime) {
69+
this.customerId = customerId;
70+
this.shopId = shopId;
71+
this.moduleId = moduleId;
72+
this.beginTime = beginTime;
73+
this.endTime = endTime;
74+
}
75+
}
76+
1577
public static void testDelItemFromMap(){
1678
Map<String, String> map = new HashMap<String, String>();
1779
map.put("aa", "aa");

web/spring-config.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,15 @@ Spring 配置的方式可以分为:
1515
- @Repository
1616
- @Component
1717
- @Autowired
18+
- @ModelAttribute
19+
- @RequestBody
20+
- @PathVariable
21+
- @RequestParam
22+
- @ResponseBody
1823

1924
- Java 注解
25+
26+
- @Resource
2027

2128
## Spring 在 xml 如何配置 Map、List
2229
1. 使用 `xmlns:util="http://www.springframework.org/schema/util` 在 xml 中配置 map 和 list 的 bean。

0 commit comments

Comments
 (0)