Live data from Hacker News

Ask HN: How PostgreSQL source code is 3x shorter than MySQL's one?

news.ycombinator.com

21–30 of 37 posts

Re: Ask HN: How PostgreSQL source code is 3x shorter than MySQL's one?

#21

Earlier quoted context omitted.

If you're a developer, a database is just a database. 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 th…

sigh Must you really draw conclusions about the suitability of PostgreSQL or MySQL for all users based on your limited perspective/niche needs? > If you're a developer, a database is just a database. [screams internally]

Yeah I mean as a developer I’ve never had the luxury to ignore storage concerns.

At bigger companies they might abstract it out but your gonna get a slow query one day and be tuning sql or something.

Re: Ask HN: How PostgreSQL source code is 3x shorter than MySQL's one?

#22

Earlier quoted context omitted.

If you're a developer, a database is just a database. 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 th…

> MySQL is a perfect match for most SaaS applications that deal with compliance. Postgres is simply not. I find this statement amazingly weird. In my experience, MySQL's access grants are extremely impoverished compared to Postgres (even in 8). It doesn't have row level security either. > The main issues with managing Postgres today are grant inheritance roles + `INHERIT` (which has been available since at least 8.1,…

The reality is that I commonly see MySQL production applications use non-admin accounts, and have never seen that for Postgres. So there is a problem.

Can you see if there is a grant similar to MySQL's FILE for COPY FROM/TO in Postgres? The last time I checked in early 2019, there wasn't.

Re: Ask HN: How PostgreSQL source code is 3x shorter than MySQL's one?

#24

One 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 developer, a database is just a database. 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 th…

I used to think this. I was surprised when DHH said hey.com uses MqSQL as back end. https://twitter.com/dhh/status/1275901955995385856

Re: Ask HN: How PostgreSQL source code is 3x shorter than MySQL's one?

#25

So I cloned the mysql-server and postgres repos and ran sloccount. It's not the deepest dive or anything but was interesting. I saw MySQL had...600k lines of JavaScript? It turned out that the storage/ndb directory had a Web-based management interface for NDB, which vendors in the Dojo JavaScript framework. It also had ~50k lines of Java for the "ClusterJ" framework, which interfaces with NDB skipping the SQL layer.…

postgresql can use ICU and on some platforms it's the only way to get utf8 collations.

Re: Ask HN: How PostgreSQL source code is 3x shorter than MySQL's one?

#26

Earlier quoted context omitted.

sigh Must you really draw conclusions about the suitability of PostgreSQL or MySQL for all users based on your limited perspective/niche needs? > If you're a developer, a database is just a database. [screams internally]

Yeah I mean as a developer I’ve never had the luxury to ignore storage concerns. At bigger companies they might abstract it out but your gonna get a slow query one day and be tuning sql or something.

> I’ve never had the luxury to ignore storage concerns

You're way out of date.

There's no storage concerns with the default since 2010 in MySQL, Innodb:

https://en.wikipedia.org/wiki/InnoDB

Re: Ask HN: How PostgreSQL source code is 3x shorter than MySQL's one?

#27

So I cloned the mysql-server and postgres repos and ran sloccount. It's not the deepest dive or anything but was interesting. I saw MySQL had...600k lines of JavaScript? It turned out that the storage/ndb directory had a Web-based management interface for NDB, which vendors in the Dojo JavaScript framework. It also had ~50k lines of Java for the "ClusterJ" framework, which interfaces with NDB skipping the SQL layer.…

NDB is a specialized cluster database where all secondary indexes have to fit in the cluster's RAM(!).

That’s not that wild of a design principle: It’s been longstanding best practice to scale OLTP databases (and limit indexing) as to keep secondary indexes buffered in memory.

Re: Ask HN: How PostgreSQL source code is 3x shorter than MySQL's one?

#30

That the source is much larger I don't mind _so much_. But this recent thing mysql is doing worries me more. ls -lah /usr/sbin/mysqld -rwxr-xr-x 1 root root 1.1G Mar 26 2020 /usr/sbin/mysqld 1.1G binary.

How did that happen? This system's `mysqld` (from mariadb-10.4.14) is 22 MB. Even the biggest binary is only 100 MB.

    stat -c '%s %n' /usr/{bin,sbin}/*|sort -nr|head -20
    100034576 /usr/bin/blender
    63352576 /usr/bin/godot
    61299448 /usr/bin/scummvm
    61004336 /usr/bin/godot-headless
    55123448 /usr/bin/podman
    42794056 /usr/bin/podman-remote
    30582984 /usr/bin/makemkv
    29998400 /usr/bin/godot-runner
    29340272 /usr/bin/cabal
    28086824 /usr/bin/node14
    27641920 /usr/bin/godot-server
    25842880 /usr/bin/restic
    25345200 /usr/bin/krita
    24520736 /usr/bin/lto-dump-10
    22376736 /usr/bin/mariabackup
    22041432 /usr/sbin/mysqld
    17203016 /usr/bin/clementine
    15435056 /usr/bin/z3
    15360752 /usr/bin/doxygen
    14694288 /usr/bin/php
Post reply on HN