MySQL vs PostgreSQL benchmarks. The system will generate tables containing test data. For that purpose, random points from areas within Sweden (see data.geojson
) are chosen.
PostgreSQL requires the earthdistance
package.
create extension cube;
create extension earthdistance;
Make sure your MySQL server instance contains a geo
table.
# Generate and fill database tables necessary for benchmarks
make
# Run benchmarks
./mysql.sh
./postgres.sh
-- MySQL
SELECT (6378.137 * acos(cos(radians(ST_X(p1))) * cos(radians(ST_X(p2))) * cos(radians(ST_Y(p2)) - radians(ST_Y(p1))) + sin(radians(ST_X(p1))) * sin(radians(ST_X(p2))))) AS distance
-- vs PostgreSQL
SELECT (p1 <@> p2) * 1.609344 AS distance
The test bench was running an Intel(R) Xeon(R) Platinum 8168 CPU @ 2.70GHz.