MySQL: Guides and Practical Know-how | Page 10 | mironsoft Blog
MySQL
-
Mar 10, 2025
Not every ALTER TABLE statement costs the same in MySQL. Some changes are pure metadata operations that finish in milliseconds, others copy the entire table in the background and block writes for seconds or minutes. Anyone running hundreds of gigabytes of Magento tables who does not know the difference between ALGORITHM=INSTANT, INPLACE and COPY risks unplanned downtime in the middle of business hours.
-
Mar 6, 2025
A single list query followed by one query per item inside a loop looks harmless during development, yet turns into hundreds or thousands of database calls per page request under production load. This article shows how to spot the N+1 query problem in ORM and collection code, fix it with eager loading and batch queries, and keep it from returning with profiling tools.
-
Mar 3, 2025
On multi-socket servers, not every byte of RAM is equally close to every CPU. NUMA describes exactly this asymmetry, and anyone running MySQL or PHP-FPM without regard for NUMA nodes risks silent latency losses that no single application-level setting can explain.
-
Feb 28, 2025
A covering index contains every column a query needs, so the server never has to touch the actual table. Anyone who applies this technique deliberately turns expensive random I/O against the table into pure, sequential index-only scans, often saving more time than any additional hardware would.
-
Feb 25, 2025
MySQL already caches database pages in the InnoDB buffer pool in RAM. If the Linux kernel simultaneously uses its own page cache for the same data, double buffering occurs: the same memory content sits twice in RAM without any extra benefit. O_DIRECT deliberately bypasses the page cache and hands full caching control to InnoDB, while buffered I/O remains the more pragmatic choice in certain scenarios.
-
Feb 21, 2025
Partitioning promises faster deletes and better maintainability for very large tables, but it is not a universal performance tool. RANGE, LIST and HASH partitioning solve different problems and bring their own restrictions around foreign keys, unique keys and query planning that need to be understood before adoption.
-
Feb 15, 2025
Adding a column or changing an index on a table with millions of rows in a live Magento store risks long table locks and a visible outage at checkout. A well planned zero-downtime migration combines declarative schema deployments with online schema change tools such as gh-ost and pt-online-schema-change, so customers never notice a schema change happening underneath them.
-
Feb 13, 2025
A Magento Docker stack consists of at least five services: PHP-FPM, Nginx, MySQL, Redis, and OpenSearch. Add RabbitMQ for message queues and Varnish for full page caching. How these services are correctly networked, persisted, and started in the right order determines stability and maintainability.
-
Feb 12, 2025
PhpStorm ships with a full featured database client that replaces TablePlus, phpMyAdmin or DBeaver for most development tasks. Set up connections, write SQL with autocompletion, visualize schemas and create dumps, all without leaving the IDE and with direct context to the open PHP file.
-
Feb 2, 2025
A MySQL major version upgrade is not a simple package update command, it is a one-way street with several silent behavior changes that only surface after the upgrade. Between MySQL 5.7 and 8.0 lie changes to the optimizer, the default character encoding, authentication, and the entire query cache subsystem, all of which can hit a production Magento shop hard if they are not known before the upgrade.