cyclestreets / cyclestreets/cyclestreets-setup
Compress large read only table
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 11
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
The map_leg_detail table describes the edges in the routing graph. Some of these are CSV fields (e.g. distances and elevations) which compress well.
The following technique (based on this) has been manually applied to the current routing edition, reducing the table size from 13G to just under 6G. After the compression procedure the table works in the same way as previously. The reduced data size should yield a modest performance boost, although no benchmarking has been performed.
This procedure could be added to the main build process, but is a bit fiddly as involves working as root user on the command line, possibly while the mysql service is stopped.
# root@build.cyclestreets:#
cd /var/lib/mysql/routing190109
# File sizes before compression (data for routing190101 is 13G)
ls -lh map_leg_detail.*
# Check status
myisamchk -dvv map_leg_detail
# Pack (takes five minutes)
date
myisampack map_leg_detail
date
# Check compressed tables (takes three minutes)
date
myisamchk -rq map_leg_detail
date
# File sizes after compression
ls -lh map_leg_detail.*
# Data file is 5.9G (before was 13G)
# Flush tables
mysql -uroot -e "flush tables;"
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the deployment or build scripts in this repository and compare them with the documented commands for the map_leg_detail table. Determine how the procedure can be incorporated without unsafe service or root-user assumptions. Done means the build process handles the compression and verifies the resulting table and file sizes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, shell
- Domain
- databases, devops
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100