Online DDL Space Requirements techniques for changing table structure, consider end-user perception of performance, based on factors such as load times for web pages. Space requirements for in-place online DDL operations are outlined below. Space requirements do not apply to operations that are performed instantly. A temporary log file records concurrent DML when an online DDL operation creates an index or alters a table. The temporary log file is extended as required by the value of  innodb_sort_buffer_size  up to a maximum specified by  innodb_online_alter_log_max_size . If a temporary log file exceeds the size limit, the online DDL operation fails, and uncommitted concurrent DML operations are rolled back. A large  innodb_online_alter_log_max_size  setting permits more DML during an online DDL operation, but it also extends the period of time at the end of the DDL operation when the table is locked to apply logged DML. If the operation takes a long time and concurrent DML modifies the table so much that the size of the temporary log file exceeds the value of  innodb_online_alter_log_max_size , the online DDL operation fails with a  DB_ONLINE_LOG_TOO_BIG  error. Online DDL operations that rebuild the table write temporary sort files to the MySQL temporary directory ( $TMPDIR  on Unix,  %TEMP%  on Windows, or the directory specified by  --tmpdir ) during index creation. Temporary sort files are not created in the directory that contains the original table. Each temporary sort file is large enough to hold one column of data, and each sort file is removed when its data is merged into the final table or index. Operations involving temporary sort files may require temporary space equal to the amount of data in the table plus indexes. An error is reported if online DDL operation uses all of the available disk space on the file system where the data directory resides. If the MySQL temporary directory is not large enough to hold the sort files, set  tmpdir  to a different directory. Alternatively, define a separate temporary directory for online DDL operations using innodb_tmpdir . This option was introduced to help avoid temporary directory overflows that could occur as a result of large temporary sort files. Some online DDL operations that rebuild the table create a temporary intermediate table file in the same directory as the original table. An intermediate table file may require space equal to the size of the original table. Intermediate table file names begin with  #sql-ib  prefix and only appear briefly during the online DDL operation. Before the introduction of online DDL, it was common practice to combine many DDL operations into a single  ALTER TABLE  statement. Because each  ALTER TABLE  statement involved copying and rebuilding the table, it was more efficient to make several changes to the same table at once, since those changes could all be done with a single rebuild operation for the table. The downside was that SQL code involving DDL operations was harder to maintain and to reuse in different scripts. If the specific changes were different each time, you might have to construct a new complex  ALTER TABLE  for each slightly different scenario. 3194 15.12.4 Simplifying DDL Statements with Online DDL •Space for an intermediate table file •Space for temporary sort files •Space for temporary log files 15.12.3 Online DDL Space Requirements The  innodb_tmpdir  option is not applicable to intermediate table files.