Recently, the subject of database indexes has come up a couple of times, specifically, in the The Downside of Database Indexing and The Impact of Database Indexes On Write Operations articles. Both pieces alluded to the fact that relational databases support a number of index types. Today's blog will provide an overview of the most common ones.
Over time, system requirements change. These may necessitate the creation of new databases, tables, and columns as well as the altering of existing table structures. Changing a column's data type may be a trivial operation or a difficult one, depending on the source and target data types, as well as the data contained within the column. This blog will address some of the common challenges in changing a column's data type, along with strategies which you can employ to facilitate the process.
Although MySQL DECIMAL and NUMERIC data types are both fixed-point values, they are still susceptible to rounding errors. The reason is that, no matter how many digits a type can accommodate (the maximum number of digits for DECIMAL is 65!) that number is still fixed. Moreover, DECIMAL columns can be assigned a precision or scale that could have the potential affect of truncation to the allowed number of digits.
MySQL provides several different log files that can help you find out what's going on inside your MySQL server instance. These include:
- error log
- isam log
- general query log
- binary log
- slow log
Of these, the slow query log is especially useful for finding inefficient or time-consuming queries, which can adversely affect database and overall server performance. This blog will describe how to read and interpret slow query log output to better debug query performance.
Usually, when your database runs slower for an extended period, the culprit is more often than not a "bad" query. That is to say, a query that is not fully optimized, poorly written, or gives users the ability to fetch an unlimited number of rows from the database. We can alleviate some pain by throwing more resources at the server, but this is really a short term fix and doe not address the underlying issue. The best course of action is to identify and fix the problem query or queries, which shouldn't be too difficult, given some time and effort. Of course, the first step is to identify which query or queries is/are the stalwarts. There are a few ways to do that, depending on your specific database type. Today's blog will highlight a few strategies for MySQL.
- 2024 (1)
- 2023 (1)
- 2022 (1)
- 2021 (1)
- 2020 (1)
- 2019 (1)
- 2018 (1)
- 2017 (1)