Explore tens of thousands of sets crafted by our community.
Database Performance Tuning
10
Flashcards
0/10
Query Optimization
Query optimization involves rewriting queries for efficiency and speed. An example would be selecting only the columns needed in a SQL SELECT statement rather than using SELECT *.
Hardware Upgrades
Upgrading hardware can provide a simple yet effective performance boost. For instance, adding more RAM or switching to faster SSD storage can drastically reduce database access times.
Denormalization
Denormalization involves adding redundant data to a database to improve read performance. This could mean including a user's last login date in both the 'users' and 'audit_log' tables for quicker access.
Caching
Caching temporarily stores results of expensive operations. For example, the results from a frequently run query can be stored in cache to provide quick access to data without re-running the query.
Connection Pooling
Connection pooling reuses database connections for multiple requests. This avoids the overhead of establishing a new connection for every query and can be seen in the use of a connection pool in a web application server.
Database Normalization
Normalization eliminates data redundancy and ensures data dependencies make sense. For instance, the third normal form (3NF) requires that all the attributes of a table are dependent on the primary key. This avoids duplicate entries and maintains data integrity.
Batch Processing
Batch processing handles large volumes of data at once to reduce overhead. An example is performing daily updates to customer records as a single batch job, rather than continuous update queries throughout the day.
Partitioning
Partitioning splits a database into smaller, more manageable pieces. Horizontal partitioning, for example, may divide a large table by rows, such as splitting a sales table into separate tables for each year.
Database Sharding
Sharding distributes data across multiple databases to spread the load. For example, a global application might shard its user database geographically to ensure lower latency and load per server.
Indexing
Indexing improves the speed of data retrieval operations by effectively creating a data structure that can be quickly traversed. For example, using a B-tree index on a 'users' table for the 'username' column allows more rapid searching of that column.
© Hypatia.Tech. 2024 All rights reserved.