The Left-Prefix Index Rule is determined by the B+tree structure

联合索引遵循「最左匹配原则」,MySQL 联合索引创建的时候会对 (a, b) 其中的 a 先进行排序,再在 a 的基础上对 b 进行排序。如果是 (a, b, c) 也是一样的方式...

February 10, 2023 · 1 min · 428 words · Lucius Chen

The difference between B-tree and B+tree

B-Tree B+Tree All internal nodes and leaf nodes contain data pointers along with keys. Only leaf nodes contain data pointers along with keys, internal nodes contain keys only. There are no duplicate keys. Duplicate keys are present in this, all internal nodes are also present at leaves. Leaf nodes are not linked to each other. Leaf nodes are linked to each other. Sequential access of nodes is not possible. All...

February 10, 2023 · 1 min · 385 words · Lucius Chen

Heap Table

Discourse context A heap is a table without a clustered index. One or more nonclustered indexes can be created on tables stored as a heap. Data is stored in the heap without specifying an order. Usually data is initially stored in the order in which is the rows are inserted into the table, but the Database Engine can move data around in the heap to store the rows efficiently; so...

February 10, 2023 · 1 min · 381 words · Lucius Chen

Clustered Indexes / Index Organized Tables (IOT)

Some databases can indeed use an index as primary table store. The Oracle database calls this concept index-organized tables (IOT), other databases use the term clustered index. In this section, both terms are used to either put the emphasis on the table or the index characteristics as needed. An index-organized table is thus a B-tree index without a heap table. This results in two benefits: (1) it saves the space...

February 10, 2023 · 2 min · 580 words · Lucius Chen

Lucius's Workflow

Figure 1: workflow 如上图所示,融合了笔记和 GTD 管理。 GTD Capture To-Dos 分为的来源分为六种: Habit Track: 即对于重复事件的循环,有利于习惯的养成。 Cyclic Tasks: 需要循环的任务。 生日提醒 周报...

February 10, 2023 · 4 min · 1774 words · Lucius Chen

Excalidraw

在 Obsidian 中可以通过 command palette 中搜索 Insert LaTeX formula 就可以弹出弹框输入 \(\textsc{LaTeX}\) 表达式了。其中的 \color{} 可以指定生成文本的颜色。

February 10, 2023 · 1 min · 46 words · Lucius Chen

JavaScript Refactoring

Refactoring Tips Refactoring Condition statements Converting callbacks to promises Refactoring Promise chains with async/await Refactoring Code examples Callback Hell

February 10, 2023 · 1 min · 19 words · Lucius Chen

Beancount

precision Beancount 会统计写过的每个货币的金额,然后选择最常见的作为显示格式,如果大多数时候都是整数,它就会用整数显示,所以最好尽量都写成你想要看到的精度,...

February 10, 2023 · 1 min · 106 words · Lucius Chen

Karabiner-Elements

平时是使用苹果内置键盘以及 HHKB,因为键位有一些不同,设置上也会有一些区别。 Figure 1: Karabiner-Elements --- global: check_for_updates_on_startup: true show_in_menu_bar: true show_profile_name_in_menu_bar: true profiles: - complex_modifications: parameters: basic.simultaneous_threshold_milliseconds: 50 basic.to_delayed_action_delay_milliseconds: 500 basic.to_if_alone_timeout_milliseconds: 1000 basic.to_if_held_down_threshold_milliseconds: 500 mouse_motion_to_scroll.speed: 100 rules: - description: Change tab to...

February 10, 2023 · 2 min · 917 words · Lucius Chen

Anki

Online Dictionary Helper Figure 1: online-dictionary-helper-result Chrome extension 在线词典助手 Settings Figure 2: online-dictionary-helper-setting Anki Template 模板的样式是根据卡片内容来设置的,其中 glossary 中本身就带了样式。 front <div class="section"> <div id="front" class="items"> {{expression}}<span class="audio">{{audio}}</span> </div> {{#reading}} <hr /> <div id="front-extra1" class="items"> <span>{{reading}}&nbsp;</span> <span>{{extrainfo}}</span> </div> {{/reading}} </div> back...

February 10, 2023 · 1 min · 233 words · Lucius Chen