Pingu
Computer MySQL PostgreSQL Books Publications
Spielereien Kanu Business TopoDB POI Klettersteigen History TransPool Thermal Baden Brokenstuben Goldwaschen
Blog Contact
Shinguz
Google
/ch/open

PostgreSQL binary size

/ home / computer / postgresql / .

Hoi D…

Du hast letzte Woche ja mal noch erwähnt, dass PostgreSQL Binaries so super klein seien im Vergleich zu MySQL Binariers (falls ich Dich richtig verstanden habe). Jetzt hat mich mal noch der Hafer gestochen und ich habe mir das bei MariaDB/MySQL etwas genauer angeschaut:

Ubuntu 24.04 / MariaDB 10.11.13 aus Ubuntu Repository:

 27M /usr/sbin/mariadbd

MariaDB Binary Tar-Balls:

 80M ./mariadb-5.5.66-linux-glibc_214-x86_64/bin/mysqld
113M ./mariadb-10.0.38-linux-glibc_214-x86_64/bin/mysqld
124M ./mariadb-10.1.43-linux-glibc_214-x86_64/bin/mysqld
151M ./mariadb-10.2.39-linux-systemd-x86_64/bin/mysqld
169M ./mariadb-10.3.20-linux-glibc_214-x86_64/bin/mysqld
233M ./mariadb-10.4.13-linux-glibc_214-x86_64/bin/mysqld
284M ./mariadb-10.5.17-linux-systemd-x86_64/bin/mariadbd
278M ./mariadb-10.6.17-linux-systemd-x86_64/bin/mariadbd
284M ./mariadb-10.6.22-linux-systemd-x86_64/bin/mariadbd
287M ./mariadb-10.11.7-linux-systemd-x86_64/bin/mariadbd
290M ./mariadb-10.11.8-linux-systemd-x86_64/bin/mariadbd
299M ./mariadb-11.4.2-linux-systemd-x86_64/bin/mariadbd
300M ./mariadb-11.4.3-linux-systemd-x86_64/bin/mariadbd
247M ./mariadb-11.5.0-linux-x86_64_MDEV-33782/bin/mariadbd
240M ./mariadb-11.6.0_vector-linux-x86_64/bin/mariadbd
367M ./mariadb-11.8.1-linux-systemd-x86_64/bin/mariadbd
371M ./mariadb-11.8.2-linux-systemd-x86_64/bin/mariadbd

MySQL Binary Tar-Balls:

  4.5M ./mysql-4.0.30/bin/mysqld
 27M   ./mysql-4.1.25/bin/mysqld
 34M   ./mysql-5.0.96-linux-x86_64-glibc23/bin/mysqld
 35M   ./mysql-5.1.73-linux-x86_64-glibc23/bin/mysqld
 44M   ./mysql-5.5.35-linux2.6-x86_64/bin/mysqld
 90M   ./mysql-5.6.46-linux-glibc2.12-x86_64/bin/mysqld
246M   ./mysql-5.7.44-linux-glibc2.12-x86_64/bin/mysqld
  1.1G ./mysql-wsrep-8.0.28-26.10-linux-x86_64/bin/mysqld
281M   ./mysql-wsrep-8.0.31-26.12-linux-x86_64/bin/mysqld
116M   ./mysql-8.0.36-linux-glibc2.12-x86_64/bin/mysqld
188M   ./mysql-8.0.39-linux-glibc2.28-x86_64/bin/mysqld
468M   ./mysql-8.0.41-linux-glibc2.28-x86_64/bin/mysqld
189M   ./mysql-8.1.0-linux-glibc2.28-x86_64/bin/mysqld
191M   ./mysql-8.2.0-linux-glibc2.28-x86_64/bin/mysqld
191M   ./mysql-8.3.0-linux-glibc2.28-x86_64/bin/mysqld
191M   ./mysql-8.4.0-linux-glibc2.28-x86_64/bin/mysqld
191M   ./mysql-8.4.1-linux-glibc2.28-x86_64/bin/mysqld
487M   ./mysql-8.4.4-linux-glibc2.28-x86_64/bin/mysqld
194M   ./mysql-9.0.0-linux-glibc2.28-x86_64/bin/mysqld

Wie so üblich, liegt der Teufel wieder mal im Detail. Wenn man die MariaDB Binaries auf Minimal trimmt dann sind wir bei 27 Mbyte (siehe Ubuntu Paket). Und wie Du sehen kannst, unterliegen die Binary-Grössen extremen Schwankungen die nicht aufgrund des Codes allein erklärt werden können, sondern an der Art des Compilierens und Linkens liegen (alle Label mit drin, allenfalls Debug-Informationen mit drin, welcher Kram wurde statisch und dynamisch dazugelinkt, etc.).

Hier müsste man sich jetzt mal die Details und Unterschiede zu PostgreSQL anschauen um einen fairen Vergleich zu erhalten.

Z. B. PostgreSQL 16 aus dem Ubuntu 24.04 Repository:

10M postgres

Quellen:

PS: Ich suche gerade verzweifelt PostgreSQL Binary-Tarballs… :-( Dann nehme ich halt die von Percona:

60M ./percona-postgresql17/bin/postgres

$ size -A -d  /usr/lib/postgresql/16/bin/postgres
/usr/lib/postgresql/16/bin/postgres  :
section                  size       addr
.interp                    28        792
.note.gnu.property         48        824
.note.gnu.build-id         36        872
.note.ABI-tag              32        908
.gnu.hash               83060        944
.dynsym                265680      84008
.dynstr                205899     349688
.gnu.version            22140     555588
.gnu.version_r            656     577728
.rela.dyn              267216     578384
.rela.plt               13080     845600
.init                      27     860160
.plt                     8736     860192
.plt.got                   96     868928
.plt.sec                 8720     869024
.text                 6568530     877744
.fini                      13    7446276
.rodata               1961174    7446528
.stapsdt.base               1    9407702
.eh_frame_hdr          146492    9407704
.eh_frame              681384    9554200
.init_array                 8   10239216
.fini_array                 8   10239224
.data.rel.ro           130088   10239232
.dynamic                  704   10369320
.got                     5136   10370024
.data                   97456   10375168
.probes                   114   10472624
.bss                   220152   10472768
.note.stapsdt            7008          0
.gnu_debugaltlink          77          0
.gnu_debuglink             52          0
Total                10693851
$ ll /usr/lib/postgresql/16/bin/postgres
-rwxr-xr-x 1 root root 10482400 May 11 11:29 /usr/lib/postgresql/16/bin/postgres
$ size -A -d  ./mysql-wsrep-8.0.28-26.10-linux-x86_64/bin/mysqld
./mysql-wsrep-8.0.28-26.10-linux-x86_64/bin/mysqld  :
section                        size       addr
.interp                          28    4194928
.note.ABI-tag                    32    4194956
.note.gnu.build-id               36    4194988
.dynsym                     1797312    4195024
.dynstr                     5504752    5992336
.gnu.hash                    623676   11497088
.gnu.version                 149776   12120764
.gnu.version_r                  864   12270540
.rela.dyn                    113880   12271408
.rela.plt                     19128   12385288
.init                            26   12404416
.plt                          12768   12404448
.text                      28962818   12417216
.fini                             9   41380036
.rodata                    13576361   41380064
.gcc_except_table            575601   54956428
.eh_frame                   2808452   55532032
.eh_frame_hdr                570948   58340484
.tdata                            8   58918112
.tbss                           176   58918120
.data.rel.ro.local           128264   58918144
.fini_array                       8   59046408
.init_array                    7272   59046416
.data.rel.ro                1396960   59053696
.dynamic                        656   60450656
.got                           9696   60451336
.got.plt                       6400   60461032
.data                       3706584   60467456
.tm_clone_table                   0   64174040
.bss                        5501192   64174080
.comment                         93          0
.debug_info               490268348          0
.debug_abbrev               8468321          0
.debug_loc                258504031          0
.debug_aranges              1637056          0
.debug_ranges              73742048          0
.debug_line                60832265          0
.debug_str                120932208          0
.note.gnu.gold-version           28          0
Total                    1079858081
$ file  ./mysql-wsrep-8.0.28-26.10-linux-x86_64/bin/mysqld
./mysql-wsrep-8.0.28-26.10-linux-x86_64/bin/mysqld: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=cfa6d4fb5302f26fb497c4ff2262c21e8d85265f, with debug_info, not stripped
$ file  /usr/lib/postgresql/16/bin/postgres
/usr/lib/postgresql/16/bin/postgres: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=a9f346af45968fd410550201b2bcfc72af40c38a, for GNU/Linux 3.2.0, stripped

tar.gz, DEB, RPM Pakete