Showing entries 1476 to 1485 of 44086
« 10 Newer Entries | 10 Older Entries »
Speed Up Your Large Table Drops in MySQL

A large table is a pain for many reasons as long as it is in a system. And as if that’s not enough, it is also a difficult task to get rid of it. In this post, we will understand why it is a pain to do this operation and what we can do about it. It will be like asking the table “Tell me what happened and I will ease up the eviction”.

So what happened? When a table is dropped (or truncated), InnoDB has to scan the pages throughout the buffer pool and remove all those belonging to that table. For a large buffer pool, this crawling in the buffer pool pages and eviction process will be slower. When we say “scan buffer pool”, it mainly looks for “LRU”, “FLUSH” (Dirty pages), and “AHI” entries.

LRU: Buffer pool pages are stored in a linked list of pages in order of usage. As the data reaches the end of the list, it is evicted to make space for new data. When the room is needed to add …

[Read more]
MySQL Metadata Queries – Find all tables in a Schema

Of course, there are other ways to determine what tables are present in a particular MySQL Database or Schema. You can also find this information if your database user account has permissions for the INFORMATION_SCHEMA database. Continue reading and follow along with an example query…

The Newsletter for PHP and MySQL Developers

Receive a copy of my ebook, “10 MySQL Tips For Everyone”, absolutely free when you subscribe to the OpenLampTech newsletter.

Image by Clker-Free-Vector-Images from  …

[Read more]
How to Setup a LAMP Stack with MySQL HeatWave – Part 1/5

LAMP is an acronym that stands for Linux, Apache, MySQL and PHP. These technologies collectively form a stack to build, deploy and manage web applications. The LAMP stack is perhaps the oldest of all web development frameworks and is still one of the most important with some commentators suggesting that up to 50% of all new web developments either use the LAMP stack or a variant of the LAMP stack.

How to Create a Table in MySQL

Creating tables is perhaps the most popular task in database development. In this article, we will review the ways of creating MySQL tables. There are two main ways of creating tables in MySQL databases: Executing a query that includes the CREATE TABLE statement Using the corresponding functionality of MySQL-related tools and IDEs The first approach […]

The post How to Create a Table in MySQL appeared first on Devart Blog.

MySQL 8.0: How to display long transactions

Recently, somebody asked me how he can find the long running transactions in MySQL.

I already have one MySQL Shell plugin that allows you to find the current transactions sorted by time. The plugin allows you to also get the details about the desired transaction. See check.getRunningStatements().

Let’s see how we can easily find those long transaction that can be a nightmare for the DBAs (see MySQL History List Length post).

SELECT thr.processlist_id AS mysql_thread_id,
       concat(PROCESSLIST_USER,'@',PROCESSLIST_HOST) User,
       Command,
       FORMAT_PICO_TIME(trx.timer_wait) AS trx_duration,
       current_statement as `latest_statement`
  FROM …
[Read more]
MySQL Replicate From Unsigned-int to Unsigned-bigint

We often see an int column of a table that needs to be changed to unsigned-int and then unsigned-bigint due to the value being out of range. Sometimes, there may even be blockers that prevent us from directly altering the table or applying pt-online-schema-change on the primary, which requires the rotation solution: apply the change on the replica first, switch over the writes to the replica, and then apply the change on the previous primary. In this case, MySQL will have to replicate unsigned-int to unsigned-bigint for a while.

One might think it is obvious and straightforward that MySQL should be able to replicate unsigned-int to unsigned-bigint because unsigned-bigint has a larger size(8 bytes) which covers unsigned-int(4 bytes). It is partly true, but there are some tricks in practice. This blog will show you those tricks through the scenarios.

Let’s understand the scenarios and issues that one may face when replicating from …

[Read more]
OpenLampTech issue #42 – Substack Repost

Welcome to this week’s OpenLampTech newsletter, the newsletter for MySQL and PHP developers. There is always something to learn and share from all the curated sources out there and OpenLampTech has the MySQL, PHP, and LAMP Stack content covered. Thank you for reading!

The Newsletter for PHP and MySQL Developers

Receive a copy of my ebook, “10 MySQL Tips For Everyone”, absolutely free when you subscribe to the OpenLampTech newsletter.

In OpenLampTech issue #42 we have articles covering:

  • Custom validation rules in Laravel
  • MySQL time-saving Date functions
  • PHP clean code tricks
  • Web scraping with PHP
[Read more]
Advanced search with PHP and MySQL

This tutorial help to create advanced search functionality with PHP and Mysql. We’ll create a PHP form that takes input and search into the MySQL table. Advanced search provides more options to the end user to filter the search result. Steps to implement advanced search PHP mysqli Create a MySQL database and populate it with […]

The post Advanced search with PHP and MySQL appeared first on Phpflow.com.

MySQL: YOLO mode

OH:

“And now let’s quickly push 2 billion rows into this database VM.”

That is best done in YOLO mode. This is a mode of operation for a database that minimizes disk writes in favor of batched bulk writes.

It is not ACID, so if anything goes wrong during the load, the instance is lost. That is why it is called YOLO mode.

You are supposed to do this on a spare replica and not the production primary. If you are not having at least one more replica than needed in your MySQL deployment, I consider your setup defective.

Disable flush on Commit

set global innodb_flush_log_at_trx_commit = 2;

This config variable

gives up ACID commits: On COMMIT, …

[Read more]
One million queries per second with MySQL

Knowing your database can scale provides great peace of mind. We built PlanetScale on top of Vitess so that we could harness its ability to massively scale. One of the core strengths in our ability to scale is horizontal sharding. To demonstrate the power of horizontal sharding, we decided to run some benchmarking. We set up a PlanetScale database and started running some benchmarks with a common tpc-c sysbench workload. We weren’t aiming for a rigorous academic benchmark here, but we wanted to use a well-known and realistic workload. We will have more benchmark posts coming and have partnered with an academic institution who will be releasing their work soon. For this post, there are two goals. The first is to demonstrate PlanetScale’s ability to handle large query volumes. For this, we set a goal of a million queries per second. In Vitess terms, this is not a large cluster. There are many Vitess clusters running at much higher query volumes, …

[Read more]
Showing entries 1476 to 1485 of 44086
« 10 Newer Entries | 10 Older Entries »