Ask HN: How PostgreSQL source code is 3x shorter than MySQL's one?
1–10 of 37 posts
Re: Ask HN: How PostgreSQL source code is 3x shorter than MySQL's one?
#2Re: Ask HN: How PostgreSQL source code is 3x shorter than MySQL's one?
#3+ What subsystems does each project have? How do LOC stack up on a per-subsystem basis?
+ Do they have different dependencies?
+ Does LOC have the same meaning in the two projects, or are there stylistic differences that meaningfully alter line counts?
+ Are statically linked binaries similarly sized?
So, it looks like you have the right question. You just need to do the digging.
Re: Ask HN: How PostgreSQL source code is 3x shorter than MySQL's one?
#4You could probably turn this into an interesting blog post. + What subsystems does each project have? How do LOC stack up on a per-subsystem basis? + Do they have different dependencies? + Does LOC have the same meaning in the two projects, or are there stylistic differences that meaningfully alter line counts? + Are statically linked binaries similarly sized? So, it looks like you have the right question. You just n…
It's not a meaningful measure in itself without digging deeper.
Re: Ask HN: How PostgreSQL source code is 3x shorter than MySQL's one?
#5Re: Ask HN: How PostgreSQL source code is 3x shorter than MySQL's one?
#6Re: Ask HN: How PostgreSQL source code is 3x shorter than MySQL's one?
#7Within a single language there's already considerable stylistic variance. I used to work in CS education and marked assignments, and I would see variances in length of students' (correct) solutions, for relatively trivial problems, that spanned a range of several multiples; e.g. what someone would take 50 lines to solve, someone else might need over 300. Part of it is comments and whitespace, but unnecessary abstract…
http://www.leancrew.com/all-this/2011/12/more-shell-less-egg...
Re: Ask HN: How PostgreSQL source code is 3x shorter than MySQL's one?
#8MySQL has more replication features, different storage engines, etc. also in MySQL GIS functionality is included and not an external plugin (like PostGIS)
The source tree you looked at probably also has ndb cluster included; if you cloned from GitHub, you also get the MySQL Router and other side components.
MySQL also bundles most external dependencies (excluding for example boost)
Any serious discussion would require deeper analysis.
P.S. I work on the MySQL team, never looked at pgsql source, so can't really judge.
Re: Ask HN: How PostgreSQL source code is 3x shorter than MySQL's one?
#9One can argue about the statement that PostgreSQL is more feature rich. MySQL has more replication features, different storage engines, etc. also in MySQL GIS functionality is included and not an external plugin (like PostGIS) The source tree you looked at probably also has ndb cluster included; if you cloned from GitHub, you also get the MySQL Router and other side components. MySQL also bundles most external depend…
If you're a corporate DBA, they are each worlds apart.
MySQL is a perfect match for most SaaS applications that deal with compliance. Postgres is simply not.
The main issues with managing Postgres today are grant inheritance, and also the lack of COPY FROM/TO grants. I shouldn't have to update grants for non-admin or readonly users after adding new objects, and there needs to be the equivalent of MySQL's FILE grant for Postgres' COPY FROM/TO.
OTOH, it is easy to reason about MySQL grants, and almost pain-free to update them in production.
If anybody can send me a link on how to make Postgres work in a corporate and/or compliance environment, let me know.
Source: DBA.