{"id":23062567,"url":"https://github.com/eschmar/great-circle-distance","last_synced_at":"2026-05-11T03:06:15.601Z","repository":{"id":73758094,"uuid":"134552744","full_name":"eschmar/great-circle-distance","owner":"eschmar","description":"MySQL vs PostgreSQL great-circle distance benchmarks","archived":false,"fork":false,"pushed_at":"2018-10-17T17:03:28.000Z","size":146,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-08T21:16:53.132Z","etag":null,"topics":["benchmark","mysql","postgresql"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eschmar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-23T10:23:02.000Z","updated_at":"2023-03-17T12:11:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"2ebe1645-c6e6-4e27-b7f5-8f01597f6870","html_url":"https://github.com/eschmar/great-circle-distance","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eschmar%2Fgreat-circle-distance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eschmar%2Fgreat-circle-distance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eschmar%2Fgreat-circle-distance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eschmar%2Fgreat-circle-distance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eschmar","download_url":"https://codeload.github.com/eschmar/great-circle-distance/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246955246,"owners_count":20860243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["benchmark","mysql","postgresql"],"created_at":"2024-12-16T03:27:26.241Z","updated_at":"2026-05-11T03:06:15.570Z","avatar_url":"https://github.com/eschmar.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Great-circle distance\nMySQL 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.\n\n## setup\nPostgreSQL requires the `earthdistance` package.\n\n```sql\ncreate extension cube;\ncreate extension earthdistance;\n```\n\nMake sure your MySQL server instance contains a `geo` table.\n\n```sh\n# Generate and fill database tables necessary for benchmarks\nmake\n\n# Run benchmarks\n./mysql.sh\n./postgres.sh\n```\n\n## select statements\n```sql\n-- MySQL\nSELECT (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\n-- vs PostgreSQL\nSELECT (p1 \u003c@\u003e p2) * 1.609344 AS distance\n```\n\n## results\n\u003cimg src=\"https://github.com/eschmar/great-circle-distance/raw/master/img/graph.png\" alt=\"Benchmarks\" style=\"max-width:100%;\"\u003e\n\nThe test bench was running an Intel(R) Xeon(R) Platinum 8168 CPU @ 2.70GHz.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feschmar%2Fgreat-circle-distance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feschmar%2Fgreat-circle-distance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feschmar%2Fgreat-circle-distance/lists"}