Every good Database Administrator (DBA) knows that tuning a database is a constant job. This is because there is always something in the database that can be changed to make it run more efficiently. But, what are some of the more common things that you should keep an eye out for if you are tuning an RDBMS? Well, let’s go through those things, but without getting too specific for any particular RDBMS (like MySQL, Oracle, etc.).
How you design your tables is very important in terms of database performance.
In general, non-RDBMS specific terms, here are some guidelines you should follow when designing tables:
Reading and writing from the disk (as in the actual hard drive on which the database is stored) is extremely expensive in terms of database performance. Operations that read and write to and from the disk are also known as I/O operations. Anyways, you have to do the best you can with the available memory (the RAM – not to be confused with disk space), so that you reduce the number of disk reads and writes to the absolute minimum necessary. Here are some approaches to reducing the number of I/O operations, and also to minimize the time spent waiting for those operations to finish:
Another important approach to correctly tuning your database for better performance is to make sure that you allocate buffers which have the right size. What exactly is a buffer? Well, it’s a part of the memory (the RAM) that is used to temporarily store data that has recently been retrieved from the database and also temporarily hold data that will eventually be stored in the permanent storage (like a disk). If you have a buffer of the right size, then data that has already been read from the database will remain in the buffer for a fair amount of time, and that means that if a new query is run asking for the same data, then it can be retrieved directly from the buffer rather than making another expensive (performance-wise) query into the database.
Buffers can also be used to store data that is written to the buffer by the RDBMS for temporary storage. Then, this data can later be copied to permanent storage at some point in the future. This is also known as asynchronous I/O because the data is not written immediately from the RDBMS to the permanent storage – all major RDBMS’s have some form of it, since it’s quite important for performance.
Database indexes are a major performance enhancer in databases. You can read more about some best practices to follow for database indexes here:
SQL Index best practices.
Would you like to thankProgrammerInterview.com for being a helpful free resource?Then why not tell a friend about us, orsimply add a link to this page from your webpage using the HTML below.
Link to this page:
Please bookmark with social media, your votes are noticed and appreciated: