Skip to content

Commit cc4cd6c

Browse files
committed
Update Java Notes
1 parent 8dc393b commit cc4cd6c

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

DB.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5112,13 +5112,15 @@ CREATE INDEX idx_seller_name_sta_addr ON tb_seller(name, status, address);
51125112

51135113
![](https://gitee.com/seazean/images/raw/master/DB/MySQL-优化SQL使用索引4.png)
51145114

5115+
虽然索引列失效,但是系统**使用了索引下推进行了优化**
5116+
51155117
* **范围查询**右边的列,不能使用索引:
51165118

51175119
```mysql
51185120
EXPLAIN SELECT * FROM tb_seller WHERE name='小米科技' AND status>'1' AND address='西安市';
51195121
```
51205122

5121-
根据前面的两个字段 name , status 查询是走索引的, 但是最后一个条件 address 没有用到索引
5123+
根据前面的两个字段 name , status 查询是走索引的, 但是最后一个条件 address 没有用到索引,使用了索引下推
51225124

51235125
![](https://gitee.com/seazean/images/raw/master/DB/MySQL-优化SQL使用索引5.png)
51245126

Prog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15072,7 +15072,7 @@ public class Server {
1507215072
Selector selector = Selector.open();
1507315073
// 5、将通道都注册到选择器上去,并且开始指定监听接收事件
1507415074
serverSocketChannel.register(selector, SelectionKey.OP_ACCEPT);
15075-
// 6、使用Selector选择器轮询已经就绪好的事件
15075+
// 6、使用Selector选择器阻塞等待轮已经就绪好的事件
1507615076
while (selector.select() > 0) {
1507715077
System.out.println("----开始新一轮的时间处理----");
1507815078
// 7、获取选择器中的所有注册的通道中已经就绪好的事件

SSM.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7897,7 +7897,7 @@ AbstractBeanFactory.doGetBean():获取 Bean,context.getBean() 追踪到此
78977897

78987898
原因:先加载 A,把 A 加入集合,A 依赖 B 去加载 B,B 又依赖 A,去加载 A,发现 A 在正在创建集合中,产生循环依赖
78997899

7900-
* `markBeanAsCreated(beanName)`:把 bean 标记为已经创建
7900+
* `markBeanAsCreated(beanName)`:把 bean 标记为已经创建,**防止其他线程重新创建 Bean**
79017901

79027902
* `mbd = getMergedLocalBeanDefinition(beanName)`:**获取合并父 BD 后的 BD 对象**,BD 是直接继承的,合并后的 BD 信息是包含父类的 BD 信息
79037903

0 commit comments

Comments
 (0)