Elasticsearch基础知识 September 14, 2019 基本概念 基本接口 集群管理 索引操作 文档操作 批量操作 搜索 分布式架构 路由 容错的机制 并发冲突 数据存储 document id _source 元数据 替换,删除 增删改操作过程 读请求操作过程 写入更新索引内部逻辑(todo) 搜索 倒排索引 分词器 mapping 搜索模式 filter 与 query 的区别 搜索类型 搜索连接词 排序 分数算法 搜索过程 实际问题解决方案 不停机重建索引 选型比较 调优 索引速度 搜索速度 基本概念 文档(document): 最小数据单元,可以是一条用户数据,通常用 json 数据结构表示 索引(index): 包含多个 document,表示一类类型的 document 类型(type): type 是 index 中的逻辑数据分类,一个 type 下的 document 拥有相同的 fields。已经不推荐使用 碎片(shard): 一个 index 会被拆分成多个 shard,分布在不同的机器中。好处:1)横向扩展;2)并行计算 复制(replica): shard 的备份 基本接口 集群管理 GET /_cat/health?v // 了解集群健康状态,green:每个索引的shard和replica都是可用的yellow:所以的shard可用,部分replica不可用;red:部分shard不可用 GET /_cat/indices?v // 查看有哪些索引
SQL优化 September 7, 2019 索引 类型 索引的优点 高性能的索引策略 索引优化实际例子 聚集索引 B-Tree 索引 结构 适用情况 不适用情况 Hash 索引 适用情况 不适用情况- 物理结构 共享池优化 绑定变量,节省解析时间 日志优化 Oracle 逻辑体系结构 最小单位 block 一个 block 能装多少行? 行迁移 行链接 优化点 段(segment) segment 高水平位 优化点 表设计 优化数据类型 MySQL 数据字段选取原则 MySQL 数据类型 MySQL 标识符选择(identifier) MySQL schema 设计中的陷阱 数据库设计范式 范式的优点 范式的缺点 反范式的优点 混用范式和反范式化 分区表 全局临时表 缓存表与汇总表 其他设计优化 计数器表 加快 MySQL ALTER TABLE速度 优化点总结 减少全表扫描 其他 索引 类型 主键:一种特殊的唯一索引,不允许有空值。 唯一键:索引列的值必须唯一,但允许有空值。 普通 组合(最左前缀):为了更多的提高 mysql 效率可建立组合索引,遵循“最左前缀”原则。创建复合索引时应该将最常用(频率)作限制条件的列放在最左边,依次递减。组合索引最左字段用 in 是可以用到索引的。 索引的优点 大大减少服务器需要扫描的数据量 帮助服务器避免排序和临时表 将随机 I/O 变为顺序 I/O
The difference between healthy and unhealthy love September 1, 2019 Video Three main goals We have three main goals: give all of us a language for talking about a subject that’s quite awkward and uncomfortable to discuss; empower a whole front line, namely friends, to help; improve all of our ability to love better signs of unhealthy love intensity Abusive relationships don’t start out abusive. They start out exciting and exhilarating. In unhealthy love, these feelings shift over time from exciting to overwhelming and maybe a little bit suffocating. It’s important to remember that it’s not how a relationship starts that matters, it’s how it evolves. It’s important in the early days of a new relationship to pay attention to how you’re feeling. It’s also really important to start practicing using your voice to talk about your own needs.