Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Online/inplace DDL operations #47

Open
hermanlee opened this issue Sep 28, 2015 · 5 comments
Open

Online/inplace DDL operations #47

hermanlee opened this issue Sep 28, 2015 · 5 comments

Comments

@hermanlee
Copy link
Contributor

Issue by spetrunia
Tuesday Jun 30, 2015 at 17:57 GMT
Originally opened as MySQLOnRocksDB#87


This task is about adding support for online (and/or in-place) DDL operations for MyRocks.

What can be supported

  • Some DDL changes have no effect on how the data is stored and so can be trivially supported:
    ** Default value changes
    ** N in char(N)
    ** possibly something else
  • Some changes may require data format change
    ** Should we try support for adding/removing non-key fields?
  • Some changes allow for in-place operation:
    ** The most important are ADD INDEX/DROP INDEX

How to support it

SQL layer will make the following calls:

h->check_if_supported_inplace_alter() // = HA_ALTER_INPLACE...
h->prepare_inplace_alter_table()
...
h->commit_inplace_alter_table

The first is to inquire whether the storage engine supports in-place operation for the given ALTER TABLE command. The latter are to actually made the change.

@alxyang alxyang self-assigned this Jan 29, 2016
alxyang added a commit that referenced this issue Jul 27, 2016
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes #182
Also part of #47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

@update-submodule: rocksdb

Test Plan:
add_index_inplace test file which currently has basic tests to cover several
corner cases + a crash recovery test using DBUG_SUICIDE

Performance test results are included in the quip document here
https://fb.quip.com/l3gDA9IjGUVw

Also ran checksum tests to ensure that data matched between two instances, one which did inplace index creation and another that was initially created with the indexes

Reviewers: yoshinorim, jkedgar, spetrunia, hermanlee4

Reviewed By: hermanlee4

Subscribers: sdong, webscalesql-eng

Differential Revision: https://reviews.facebook.net/D60837
george-lorch pushed a commit to george-lorch/percona-server that referenced this issue Oct 5, 2016
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (facebook/mysql-5.6@fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes facebook/mysql-5.6#182
Also part of facebook/mysql-5.6#47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

@update-submodule: rocksdb

Test Plan:
add_index_inplace test file which currently has basic tests to cover several
corner cases + a crash recovery test using DBUG_SUICIDE

Performance test results are included in the quip document here
https://fb.quip.com/l3gDA9IjGUVw

Also ran checksum tests to ensure that data matched between two instances, one which did inplace index creation and another that was initially created with the indexes

Reviewers: yoshinorim, jkedgar, spetrunia, hermanlee4

Reviewed By: hermanlee4

Subscribers: sdong, webscalesql-eng

Differential Revision: https://reviews.facebook.net/D60837
george-lorch pushed a commit to george-lorch/percona-server that referenced this issue Oct 5, 2016
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (facebook/mysql-5.6@fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes facebook/mysql-5.6#182
Also part of facebook/mysql-5.6#47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

@update-submodule: rocksdb

Test Plan:
add_index_inplace test file which currently has basic tests to cover several
corner cases + a crash recovery test using DBUG_SUICIDE

Performance test results are included in the quip document here
https://fb.quip.com/l3gDA9IjGUVw

Also ran checksum tests to ensure that data matched between two instances, one which did inplace index creation and another that was initially created with the indexes

Reviewers: yoshinorim, jkedgar, spetrunia, hermanlee4

Reviewed By: hermanlee4

Subscribers: sdong, webscalesql-eng

Differential Revision: https://reviews.facebook.net/D60837
@alxyang
Copy link
Contributor

alxyang commented Nov 23, 2016

https://dev.mysql.com/doc/refman/5.6/en/innodb-create-index-overview.html

we need to revisit exactly which of these we can/want to support.
From what I understand, we want to make CREATE INDEX fully online (still allows DML statements to occur).

Also on the roadmap would be renaming columns, default value changes, changing default auto increment value, adding/dropping columns.
For adding/dropping columns, it's unclear to me exactly how online DDL will be faster since it still needs to copy the table under the hood, even according to the documentation above for InnoDB. Need to investigate more here.

hermanlee pushed a commit that referenced this issue Jan 31, 2017
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes #182
Also part of #47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

@update-submodule: rocksdb

Test Plan:
add_index_inplace test file which currently has basic tests to cover several
corner cases + a crash recovery test using DBUG_SUICIDE

Performance test results are included in the quip document here
https://fb.quip.com/l3gDA9IjGUVw

Also ran checksum tests to ensure that data matched between two instances, one which did inplace index creation and another that was initially created with the indexes

Reviewers: yoshinorim, jkedgar, spetrunia, hermanlee4

Reviewed By: hermanlee4

Subscribers: sdong, webscalesql-eng

Differential Revision: https://reviews.facebook.net/D60837
Differential Revision: https://reviews.facebook.net/D61659
Differential Revision: https://reviews.facebook.net/D62331
VitaliyLi pushed a commit to VitaliyLi/mysql-5.6 that referenced this issue Feb 9, 2017
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (facebook@fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes facebook#182
Also part of facebook#47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

@update-submodule: rocksdb

Test Plan:
add_index_inplace test file which currently has basic tests to cover several
corner cases + a crash recovery test using DBUG_SUICIDE

Performance test results are included in the quip document here
https://fb.quip.com/l3gDA9IjGUVw

Also ran checksum tests to ensure that data matched between two instances, one which did inplace index creation and another that was initially created with the indexes

Reviewers: yoshinorim, jkedgar, spetrunia, hermanlee4

Reviewed By: hermanlee4

Subscribers: sdong, webscalesql-eng

Differential Revision: https://reviews.facebook.net/D60837
Differential Revision: https://reviews.facebook.net/D61659
Differential Revision: https://reviews.facebook.net/D62331
gunnarku pushed a commit to facebook/mysql-8.0 that referenced this issue Jul 21, 2017
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (facebook/mysql-5.6@fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes facebook/mysql-5.6#182
Also part of facebook/mysql-5.6#47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

@update-submodule: rocksdb

Test Plan:
add_index_inplace test file which currently has basic tests to cover several
corner cases + a crash recovery test using DBUG_SUICIDE

Performance test results are included in the quip document here
https://fb.quip.com/l3gDA9IjGUVw

Also ran checksum tests to ensure that data matched between two instances, one which did inplace index creation and another that was initially created with the indexes

Reviewers: yoshinorim, jkedgar, spetrunia, hermanlee4

Reviewed By: hermanlee4

Subscribers: sdong, webscalesql-eng

Differential Revision: https://reviews.facebook.net/D60837
Differential Revision: https://reviews.facebook.net/D61659
Differential Revision: https://reviews.facebook.net/D62331
gunnarku pushed a commit to facebook/mysql-8.0 that referenced this issue Jul 25, 2017
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (facebook/mysql-5.6@fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes facebook/mysql-5.6#182
Also part of facebook/mysql-5.6#47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

@update-submodule: rocksdb

Test Plan:
add_index_inplace test file which currently has basic tests to cover several
corner cases + a crash recovery test using DBUG_SUICIDE

Performance test results are included in the quip document here
https://fb.quip.com/l3gDA9IjGUVw

Also ran checksum tests to ensure that data matched between two instances, one which did inplace index creation and another that was initially created with the indexes

Reviewers: yoshinorim, jkedgar, spetrunia, hermanlee4

Reviewed By: hermanlee4

Subscribers: sdong, webscalesql-eng

Differential Revision: https://reviews.facebook.net/D60837
Differential Revision: https://reviews.facebook.net/D61659
Differential Revision: https://reviews.facebook.net/D62331
@baotiao
Copy link

baotiao commented Jan 18, 2018

hello @alxyang . what's going on with online DDL feature?

@yoshinorim
Copy link
Contributor

Currently we have higher priorities for 1. supporting MyRocks in MySQL 8.0 and 2. improving MyRocks/RocksDB performance. About online schema change, there are several existing solutions like https://github.com/github/gh-ost so it is not the highest priority. We will be likely to start supporting major features like online schema change based on MySQL 8.0, not 5.6.

@baotiao
Copy link

baotiao commented Jan 19, 2018

@yoshinorim Thank you. we are going to add this feature in MySQL 5.7, if it work perfectly, we can summit a path for you

@yoshinorim
Copy link
Contributor

@baotiao That is great. Please submit a pull request once it is ready!

facebook-github-bot pushed a commit that referenced this issue Dec 23, 2019
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes #182
Also part of #47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

update-submodule: rocksdb

Differential Revision: https://reviews.facebook.net/D62331

fbshipit-source-id: f777e7e
inikep pushed a commit to inikep/mysql-5.6 that referenced this issue Aug 12, 2020
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (facebook@fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes facebook#182
Also part of facebook#47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

update-submodule: rocksdb

Differential Revision: https://reviews.facebook.net/D62331

fbshipit-source-id: f777e7e
inikep pushed a commit to inikep/mysql-5.6 that referenced this issue Sep 9, 2020
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (facebook@fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes facebook#182
Also part of facebook#47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

update-submodule: rocksdb

Differential Revision: https://reviews.facebook.net/D62331

fbshipit-source-id: f777e7e
inikep pushed a commit to inikep/mysql-5.6 that referenced this issue Sep 16, 2020
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (facebook@fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes facebook#182
Also part of facebook#47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

update-submodule: rocksdb

Differential Revision: https://reviews.facebook.net/D62331

fbshipit-source-id: f777e7e
inikep pushed a commit to inikep/mysql-5.6 that referenced this issue Oct 5, 2020
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (facebook@fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes facebook#182
Also part of facebook#47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

update-submodule: rocksdb

Differential Revision: https://reviews.facebook.net/D62331

fbshipit-source-id: f777e7e
inikep pushed a commit to inikep/mysql-5.6 that referenced this issue Nov 11, 2020
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (facebook@fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes facebook#182
Also part of facebook#47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

update-submodule: rocksdb

Differential Revision: https://reviews.facebook.net/D62331

fbshipit-source-id: f777e7e
facebook-github-bot pushed a commit that referenced this issue Mar 8, 2021
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes #182
Also part of #47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

update-submodule: rocksdb

Differential Revision: https://reviews.facebook.net/D62331

fbshipit-source-id: 9e59950687b
inikep pushed a commit to inikep/mysql-5.6 that referenced this issue Aug 16, 2021
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (facebook@fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes facebook#182
Also part of facebook#47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

update-submodule: rocksdb

Differential Revision: https://reviews.facebook.net/D62331

fbshipit-source-id: 9e59950687b
inikep pushed a commit to inikep/mysql-5.6 that referenced this issue Aug 30, 2021
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (facebook@fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes facebook#182
Also part of facebook#47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

update-submodule: rocksdb

Differential Revision: https://reviews.facebook.net/D62331

fbshipit-source-id: 9e59950687b
inikep pushed a commit to inikep/mysql-5.6 that referenced this issue Aug 30, 2021
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (facebook@fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes facebook#182
Also part of facebook#47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

update-submodule: rocksdb

Differential Revision: https://reviews.facebook.net/D62331

fbshipit-source-id: 9e59950687b
inikep pushed a commit to inikep/mysql-5.6 that referenced this issue Sep 1, 2021
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (facebook@fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes facebook#182
Also part of facebook#47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

update-submodule: rocksdb

Differential Revision: https://reviews.facebook.net/D62331

fbshipit-source-id: 9e59950687b
inikep pushed a commit to inikep/mysql-5.6 that referenced this issue Sep 2, 2021
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (facebook@fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes facebook#182
Also part of facebook#47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

update-submodule: rocksdb

Differential Revision: https://reviews.facebook.net/D62331

fbshipit-source-id: 9e59950687b
inikep pushed a commit to inikep/mysql-5.6 that referenced this issue Jan 17, 2022
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (facebook@fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes facebook#182
Also part of facebook#47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

@update-submodule: rocksdb

Differential Revision: https://reviews.facebook.net/D62331
inikep pushed a commit to inikep/mysql-5.6 that referenced this issue Jan 17, 2022
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (facebook@fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes facebook#182
Also part of facebook#47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

@update-submodule: rocksdb

Differential Revision: https://reviews.facebook.net/D62331
inikep pushed a commit to inikep/mysql-5.6 that referenced this issue Jan 17, 2022
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (facebook@fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes facebook#182
Also part of facebook#47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

@update-submodule: rocksdb

Differential Revision: https://reviews.facebook.net/D62331
ldonoso pushed a commit to ldonoso/percona-server that referenced this issue Mar 15, 2022
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (facebook/mysql-5.6@fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes facebook/mysql-5.6#182
Also part of facebook/mysql-5.6#47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

@update-submodule: rocksdb

Differential Revision: https://reviews.facebook.net/D62331
inikep pushed a commit to inikep/mysql-5.6 that referenced this issue Apr 26, 2022
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (facebook@fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes facebook#182
Also part of facebook#47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

@update-submodule: rocksdb

Differential Revision: https://reviews.facebook.net/D62331
inikep pushed a commit to inikep/mysql-5.6 that referenced this issue May 20, 2022
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (facebook@fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes facebook#182
Also part of facebook#47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

@update-submodule: rocksdb

Differential Revision: https://reviews.facebook.net/D62331
laurynas-biveinis pushed a commit to laurynas-biveinis/mysql-5.6 that referenced this issue Aug 11, 2022
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (facebook@fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes facebook#182
Also part of facebook#47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

@update-submodule: rocksdb

Differential Revision: https://reviews.facebook.net/D62331
inikep pushed a commit to inikep/mysql-5.6 that referenced this issue Mar 28, 2023
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (facebook@fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes facebook#182
Also part of facebook#47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

@update-submodule: rocksdb

Differential Revision: https://reviews.facebook.net/D62331
inikep pushed a commit to inikep/mysql-5.6 that referenced this issue Jun 1, 2023
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (facebook@fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes facebook#182
Also part of facebook#47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

@update-submodule: rocksdb

Differential Revision: https://reviews.facebook.net/D62331
inikep pushed a commit to inikep/mysql-5.6 that referenced this issue Jun 14, 2023
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (facebook@fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes facebook#182
Also part of facebook#47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

@update-submodule: rocksdb

Differential Revision: https://reviews.facebook.net/D62331
inikep pushed a commit to inikep/percona-server that referenced this issue Apr 9, 2024
Summary:
This is part 2 of the changes required to support fast secondary index
creation. See Part 1 here (facebook/mysql-5.6@fbbd4aa).

Previously adding an index would require copying over the entire table and
recreating all the indexes. This diff implements the functionality required to
add an index "online", without having to rebuild the table.

Fixes facebook/mysql-5.6#182
Also part of facebook/mysql-5.6#47

Future improvements are planned in a separate diff, to support SSTFileWriter API.

@update-submodule: rocksdb

Differential Revision: https://reviews.facebook.net/D62331
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants