知識冒險者
Search
搜尋
暗色模式
亮色模式
閱讀模式
探索
sql
此標籤下有 37 條筆記。
2026年10月05日
全表掃描和索引掃描的適用場景是相反的
database
sql
index
performance
2026年10月05日
建索引的代價是毫秒,收益可能是秒
database
sql
index
performance
2026年10月05日
條件欄位沒命中索引,索引仍有三種可能被用到
database
sql
index
performance
2026年9月27日
Index Cond 是在索引上定位,Filter 是撈出來再逐筆比
database
sql
index
performance
2026年9月27日
Nested Loop 的執行順序是上外下內,不是最深的先跑
database
sql
performance
2026年9月27日
loops 大於 1 時,actual time 和 rows 是每次迴圈的平均
database
sql
performance
gotcha
2026年9月27日
估計和實際差很多,代表資料庫對這張表的認識壞了
database
sql
performance
2026年9月27日
執行計畫是一棵樹,從下往上讀
database
sql
performance
2026年9月27日
複合索引的欄位 = Index Cond 的欄位 + Filter 裡的等值欄位
database
sql
index
performance
2026年9月27日
EXPLAIN ANALYSE 完整指南(Victor Gardini)
database
sql
performance
2026年9月25日
EXPLAIN ANALYZE 會真的執行查詢
database
sql
gotcha
2026年9月25日
WHERE 決定回傳幾列,索引才決定要看過幾列
database
sql
index
performance
2026年9月25日
cost 和 actual time 的兩個數字是「啟動..總計」,不是範圍
database
sql
performance
2026年9月25日
把欄位包進函數,WHERE 就用不到那個欄位的索引
database
sql
index
performance
2026年9月22日
ACID 的隔離性是可調的,預設擋不住 write skew
database
sql
transaction
2026年9月20日
跨來源的正規形式定義寬嚴不同,記判準比記條號可靠
database
sql
schema-design
2026年9月20日
5NF 的判準不在資料裡,在業務規則裡
database
sql
schema-design
2026年9月20日
BCNF 保證無損 join,但不保證保持相依
database
sql
schema-design
2026年9月20日
BCNF 拿掉 3NF「只檢查非鍵值欄位」的前提
database
sql
schema-design
2026年9月20日
DELETE 搭 JOIN 的寫法 MySQL 與 PostgreSQL 不相容
sql
mysql
postgresql
database
2026年9月20日
JOIN 貴在每一列都要去另一張表配對
database
sql
performance
2026年9月20日
MySQL 的 DELETE 子查詢不能直接引用同一張表
sql
mysql
database
2026年9月20日
PostgreSQL 的 date 加 INTERVAL 會變成 timestamp
sql
postgresql
database
2026年9月20日
superkey 就是能唯一指出一列的欄位組合
database
sql
schema-design
2026年9月20日
反正規化要排在索引與物化視圖後面
database
sql
performance
schema-design
2026年9月20日
單一主鍵讓 2NF 自動成立,但重複一點都沒少
database
sql
schema-design
2026年9月20日
多值相依的判準是矩形完整,不是感覺獨立
database
sql
schema-design
2026年9月20日
對齊日期用 self-join,對齊前後順序用視窗函數
sql
database
performance
2026年9月20日
拆表把成本集中在一次 join,不拆表把成本攤到每一列
database
sql
performance
schema-design
2026年9月20日
正規化的三個階段是同一個問句的三種問法
database
sql
schema-design
2026年9月20日
正規化的五個階段對應三種相依性
database
sql
schema-design
2026年9月20日
正規化的判準是候選鍵,不是主鍵
database
sql
schema-design
2026年9月20日
衍生欄位該拿掉的理由不是遞移相依
database
sql
schema-design
2026年9月20日
遞移相依:欄位靠另一個普通欄位才連到主鍵
database
sql
schema-design
2026年9月20日
資料庫正規化(一~三)
database
sql
schema-design
2026年9月17日
OFFSET 分頁的總成本是 O(頁數平方),cursor 分頁才是 O(頁數)
database
sql
performance
pagination
2026年9月17日
SQL Basic
sql
mysql
database
reference