tags: MySQL

What is MySQL's Online DDL

Today I learned a MySQL term: online DDL. The online DDL lets you alter tables efficiently, without making tables unavailable during the entire operation and exclusive table locks. The behavior of a DDL operation can be specified using the ALGORITHM and LOCK clauses. You don't have to get overwhelmed by the mysterious terms. Actually, you may have used it before without knowing because MySQL will try to use it by default when you execute ordinary alter table statements.

Read more →

change_table with Bulk Option Combines Multiple alter-table Statements

Today I learned that when doing database-migration on Rails, change_table :#{table_name}, bulk: true let us combine multiple alter-table statements and it could reduce the cost of the whole alteration. That is, instead of executing multiple alter-table separately, def change add_column :users, :first_name, :string, null: false add_column :users, :last_name, :string, null: false end we can run a single alter-table statement by change_table like as follows. def change change_table :users, bulk: true do |t| t.

Read more →

Gentaro "hibariya" Terada

Otaka-no-mori, Chiba, Japan
Email me

Likes Ruby, Internet, and Programming.