Skip to main content
Engineering

Why Uber Engineering Switched from Postgres to MySQL

26 July 2016 / Global
Featured image for Why Uber Engineering Switched from Postgres to MySQL
idfirstlastbirth_year
11623
21646
31882
4780
51912
61887
71815
81854
ctididfirstlastbirth_year
A1BlaisePascal1623
B2GottfriedLeibniz1646
C3EmmyNoether1882
D4Muhammadal-Khwārizmī780
E5AlanTuring1912
F6SrinivasaRamanujan1887
G7AdaLovelace1815
H8HenriPoincaré1854
idctid
1A
2B
3C
4D
5E
6F
7G
8H
firstlastctid
AdaLovelaceG
AlanTuringE
BlaisePascalA
EmmyNoetherC
GottfriedLeibnizB
HenriPoincaréH
Muhammadal-KhwārizmīD
SrinivasaRamanujanF
birth_yearctid
780D
1623A
1646B
1815G
1854H
1887F
1882C
1912E
ctidprevidfirstlastbirth_year
Anull1BlaisePascal1623
Bnull2GottfriedLeibniz1646
Cnull3EmmyNoether1882
Dnull4Muhammadal-Khwārizmī780
Enull5AlanTuring1912
Fnull6SrinivasaRamanujan1887
Gnull7AdaLovelace1815
Hnull8HenriPoincaré1854
ID4Muhammadal-Khwārizmī770
firstlastctid
AdaLovelaceG
AlanTuringE
BlaisePascalA
EmmyNoetherC
GottfriedLeibnizB
HenriPoincaréH
Muhammadal-KhwārizmīD
Muhammadal-KhwārizmīI
SrinivasaRamanujanF
birth_yearctid
770I
780D
1623A
1646B
1815G
1854H
1887F
1882C
1912E
Postgres_Tuple_Property_
With Postgres, the primary index and secondary indexes all point directly to the on-disk tuple offsets. When a tuple location changes, all indexes must be updated.
firstlastid (primary key)
AdaLovelace7
AlanTuring5
BlaisePascal1
EmmyNoether3
GottfriedLeibniz2
HenriPoincaré8
Muhammadal-Khwārizmī4
SrinivasaRamanujan6
MySQL_Index_Property_
MySQL uses an extra layer of indirection: secondary index records point to primary index records, and the primary index itself holds the on-disk row locations. If a row offset changes, only the primary index needs to be updated.

Posted by Evan Klitzke

Category: