MySQL vs PostgreSQL: source lines of code compared

This page compares the source lines of code (SLOC) of mysql/mysql-server and postgres/postgres using cached OctoCounts reports. Code size is not code quality: a larger count only means more source material, not a better or worse project.

As of 2026-08-26, mysql/mysql-server contains 10,375,438 total lines (6,974,636 code) across 33,534 files, while postgres/postgres contains 2,935,030 total lines (1,635,202 code) across 4,141 files as of 2026-09-07. mysql/mysql-server is about 4.3x the size of postgres/postgres by code lines. Code size is not code quality: a larger count only means more source material, not a better or worse project.

Metricmysql/mysql-serverpostgres/postgres
Files33,5344,141
Total lines10,375,4382,935,030
Code lines6,974,6361,635,202
Comment lines2,207,181889,139
Blank lines1,193,621410,689
Languages counted1212

Top languages in mysql/mysql-server: C++ Header (34.5% of code), C++ (34.2% of code), C Header (13.6% of code). Top languages in postgres/postgres: C (59.4% of code), PO File (25.0% of code), C Header (7.3% of code). C Header, C appear in both top language lists; C++ Header, C++, Bitbake appear only in mysql/mysql-server's top languages; PO File, SQL, Perl appear only in postgres/postgres's top languages.

Methodology: both counts come from cached OctoCounts reports generated with tokei. mysql/mysql-server was counted at ref trunk (commit 23e360a7fac7) on 2026-08-26; postgres/postgres was counted at ref master (commit f836b688f8dc) on 2026-09-07. See the counting methodology for ignored directories and analysis options.

Evidence and next steps:

Note: code size is not code quality. OctoCounts only reports reproducible line counts and makes no claim that either project is better.

Compare FAQ

Which has more lines of code, mysql/mysql-server or postgres/postgres?

mysql/mysql-server has more code: 6,974,636 code lines versus 1,635,202 for postgres/postgres, about 4.3x as much, based on cached OctoCounts reports as of 2026-09-07.

Does more source lines of code mean more complexity?

Not necessarily. SLOC measures size, not complexity, quality, or maintainability. A larger codebase can mean more features, more generated or vendored code, more verbose language idioms, or more tests — none of which imply the code is harder to work with. Use SLOC to gauge the scale of what you'd be reading or maintaining, not as a quality signal for mysql/mysql-server, postgres/postgres, or any repository.

How is this comparison calculated?

Methodology: both counts come from cached OctoCounts reports generated with tokei. mysql/mysql-server was counted at ref trunk (commit 23e360a7fac7) on 2026-08-26; postgres/postgres was counted at ref master (commit f836b688f8dc) on 2026-09-07. See the counting methodology for ignored directories and analysis options.

Can I compare a different branch, tag, or commit?

Yes. This page shows the default branch for each repository. Use the interactive comparison tool to pick any public GitHub repository, branch, tag, or commit SHA for both sides and get a fresh side-by-side report.