????Markus Winand ??????????????С?SQL Performance Explained????顣2013 ?? Uber ?? MySQL ???? PostgreSQL?????? 2016 ?? 8 ?£?Uber ???????????????? PostgreSQL ??? MySQL?????????????????飬Markus д??????????????????
?????????????? Uber ?? PostgreSQL ???? MySQL ??????????????????????????????????????δ??????????????????
????2016 ?? 8 ?£?Uber ???????????????? Uber ????? PostgreSQL ?????? MySQL??????????????????????????????????????????????????Щ??????????????????????У??????????????????????“??? PostgreSQL ????????????”?????  PostgreSQL ????????????????Щ???????????????????д??Щ???????????????????? Uber ???????
?????????????Uber ????????????????????? MySQL ?? PostgreSQL ???????????????????????????????????????????????????????????????д“  PostgreSQL ?? update-heavy ????ó????????Щ????”??????д??“??????д??write???????????????Ч????”????????? updata-heavy ????ó????????????? Uber ??????????????????
??????????У???????????????????? Uber ?????2??????????????????????????????????飬????? MySQL ????????? Uber??????????????????????????????????????????????????????
????????·????????
????Uber ???????????????????????? ????±??е??????PostgreSQL ?????????±??????????????????????????????????????????????????????????棬??????? InnoDB ?? MySQL ???????????????Щ?????и????е???????????????????????????????е??Write Amplification?????????PostgreSQL ?????????????????? IO???????? Uber ??????????????????Щ???????????????????????????????????е?????????
??????????????Щ?2??? Uber ???2?????????????????? PostgreSQL ?? Heap-Only-Tuples( HOT )???? PostgreSQL ?????????HOT ?????Щ????????????????“???????????????????????????????????????н??и???”????????????У?????μ??а汾?????????汾?洢??????????У?PostgreSQL ????????Щ??????????κ??????????????????????????  fillfactor ?????е?г?????? Uber ???????? HOT ????????????????????????Щ???????????????????????С?
???????????????????е????????????????“??????????????????????????????????????????????????????±????漰??????12???????????μ????е? ctid ”????????????“?????????????”????????????????????????????? PostgreSQL ?? HOT ????????????????
??????????????????????????е?????????????????— index redesign  ???????????????????Σ???????Щ????????????????????????????????????????п???????
????????????????????????????£???Щ??????????????????У?????????????????????????????????????????????????????????????????? MySQL ????? PostgreSQL ??????????
???????? Select ??????
????????????????????????????????????????????????? MySQL/InnoDB ????? clustered indexed ???????????“?????????ζ?????????ι?????????? Postgres ??? InnoDB ?????????????”?????????????the clustered index penalty????????д???? SQL Server ?????μ??????
????????д?? clustered index penalty ???????С???????????????????????????????????????????????????????????????????????????????????????????????С??????????????Щ???????ú????????ζ?????????????????????? primary key ?????в???????????????? clustered index penalty ??????????д????“????”??????“???”???????е???????? clustered index penalty ???????? where ????????????????????????????ζ?????????′?????primary key??
?????????й????????????????????PostgreSQL??  index-only scans ????????????????????±???????????? PostgreSQ L?? index-only scans  ??ж??????????????????????????????????????????? 2011 ????????????д?????????2012 ?? PostgreSQL 9.2 ?? index-only scans ??????Щ???????????Щ?????????????????????2014 ?????????? PgCon ?????????????????檔????? Uber ????б????????????????????????????????????2??????????????  replicas ????????н???????????????????????????? primary key ???????
??????????????e????????????????????????/??洢?????? Innodb ??????????????е??/??洢?????????????Щ???? InnoDB ???Щ???????????????? SQL ????????? MySQL ?? MariaDB ???????е????????????????????????????????/??洢???????????????????? SQL ????? MySQL ?????? MariaDB ?????????????2?????????κ?????? NoSQL ??/??洢????????????????Щ????????? SQL-ish ??????????????Uber ?????????????????????? InnoDB ?? MySQL ?????????????????????“Schemaless”????
?????????????????Rebalancing??
??????????????????????????????棺???? B-tree ??????????????“?????”?????????????????????????????? “Rebalancing after deletion”???????????????????????????????????????????????????????????????????????????????????? half-full ????????????????? PostgreSQL ?????Lehman?? Yao variation of B-trees?????????????????????????????????????????PostgreSQL ???????????е???????μ?“ Indexing Internals” ?????? 15 ????????????????????????????
???????????????????仰??“B-tree ?к?????棬??????????????????rebalancing??…”???????????????????????????????е?????????????????????????ε??????????仯??????????????????????????????????д??“…????????????μ? no-disk λ???????Щ rabalancing ???????????????”??????????????“rebalancing”?????????????????????????????????
??????? B-tree ?е????????????????????????????????????????????????????????????????????????????????????????????????????? 100 ?β????з?????Ρ???????????μ??????????????????μ????????????????????????????????????????? Lehman ?? Yao ?????????????????????Щ????£??μ?????????????????У???????????????????????????????????????£????????з??????????е?????
??????????????£???????????????????????з???????????????????????μ???????????????£???? B-tree ????????????????????????????Ч???????????????????????????????????????????????????????????????£???????????????????level???????????????????μ?????????е????????????????????????????????????з?????? 5 ?Ρ????????????£?????????????????????????????????????????“???????”??????????????????????????????????????????????????????洢?????????????