4 ms·
In my current job I maintain a database of 2B records that is (unfortunately) on spinning rust and on a last-gen Intel desktop CPU system. This database is a re
by gravypod 9y ago
In my current job I maintain a database of 2B records that is (unfortunately) on spinning rust and on a last-gen Intel desktop CPU system. This database is a read-only data warehousing sort of setup.
If you need to do operations like this on a database with this setup I'd suggest checking out the following config options:
1. max_heap_table_size
2. read_buffer_size
3. sort_buffer_size
4. join_buffer_size
5. thread_concurrency
6. tmp_table_size
I'd also suggest looking into TEMPORARY TABLEs with ENGINE=MEMORY.
I have not included values in this because the values that make sense for you are likely not the values that make sense for me. Check out MySQL's documentation for what these values effect [0]. The defaults in even MySQL's huge config are very outdated for the horsepower that modern computers bring to the table. It's funny that MySQL's once massive 4GB of RAM config file is now the appropriate setup for my laptop.
[0] - https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html https://dev.mysql.com/doc/refman/5.7/en/server-system-variab...
- wvenable 9y agoTo set these variables appropriate for your system, I recommend the MySQL tuner script: https://github.com/major/MySQLTuner-perl https://github.com/major/MySQLTuner-perl
- a012 9y agoIs there similar tuning script for Postgres?
- danielsamuels 9y agoYes, pg_tune
- tkyjonathan 9y agoIs there a similar script for Redshift?
- Twirrim 9y agoIt's a great tool, but don't just apply advice blindly. It's guidance, not "this is the right thing to do", and some of the advice can harm as much much as help, because no one has size fits all (though I will found it to provide a excellent suggestions in general). Use it, look at the suggestions, and use that as an excellent springboard for reading up on what and why, and see how it could apply to your database.
- deleted 9y ago[deleted]
- nik736 9y agoHow much disk space do those 2B records need?
- gravypod 9y ago~200GB + ~100GB of indexes I think.