What is a median value? The median of an array of numbers is the value of the middle item in the array, assuming the array is sorted. If the array has an even number of items, the median represents the average of the two middle values in the array. This value is very popular one… Continue reading How to calculate median value in MySQL using a simple SQL query
This post is based on a true story from one of our team members. Here at EverSQL, we have high appreciation for the MySQL database. Said that, every product has its pros and cons and even some bugs here and there. So let’s dive into how we used some “bad practices” to overcome a potential… Continue reading MySQL is not using my index – Join with a range condition
Queries with LIMITs and OFFSETs are common in application that require pagination and in some cases might work well for a while. In many cases though, they become slow and painful once the OFFSET has a high value. Why OFFSET is so slow? Well, in most cases, low offset queries are not slow. The problem… Continue reading Faster Pagination in Mysql – Why Order By With Limit and Offset is Slow?
UTF8 VS UTF8MB4 – What’s the difference? You’re getting a support call from an IT administrator in a tech company saying some of his critical data can’t be saved in the product you deployed at his servers a week ago. His users are seeing a general error from the application. About 30 of his 500… Continue reading MySQL utf8 vs utf8mb4 – What’s the difference between utf8 and utf8mb4?
Do not use the old mysql api There are several ways to connect to a MySQL database in PHP. The most common ones are the MySQL API, the MySQLi API and the PDO API (PHP Data Objects). The last two support more features than the old mysql API and are more secure. If you’re using… Continue reading 5 Common Mistakes PHP Developers Make when Writing SQL
Does it matter how many indexes I create? A general rule of thumb is that the more indexes you have on a table, the slower INSERT, UPDATE, and DELETE operations will be. Indexes in MySQL (or any database for that matter) are not static. Every time we update the table (for example, using an INSERT… Continue reading How to find unused indexes in a MySQL database?
The survey results from StackOverflow’s developers survey are already here, and we can now declare the most popular databases for 2017. Without further ado, let’s look into the results: So what can we learn from these results? The most popular database is MySQL, and not by far comes SQL Server. Almost half of the developers… Continue reading Most popular databases in 2017 according to StackOverflow survey
In several RDBMS databases, including MySQL, subqueries are often one of the causes for performance issues. Therefore, we have an incentive to avoid them whenever we can and to find alternative ways to implement our requirements. One of the most popular uses for subselects in SQL is when one needs to fetch the first, last,… Continue reading Select max, min, last row for each group in SQL without a subquery
MySQL is arguably the most popular and common RDBMS. The last major release was MySQL 5.7 back in 2013. As of today, several development milestones were declared for MySQL v8.0, but there is no official release available yet. Even though there is no official software release to download and use yet, the list of features for MySQL 8.0 was… Continue reading MySQL 5.7 vs MySQL 8.0 – What’s new in MySQL 8.0?
What’s an ORM? Before going into the difference between Python’s ORM frameworks (Django and SQLAlchemy), let’s make sure we fully understand the use of ORM frameworks in general. ORM stands for Object Relational Mapping. Looking at each of these words will explain their use in the real world: Object – This part represents the objects and programming… Continue reading Django vs SQLAlchemy – Which Python ORM is better?