mysql - How to perform database table rename while reading from it -


after consulting mysql manual [1,2], seems performing rename of table needs global table lock. quick experiments confirm this. means if select statements executing against table, rename operation block until select statements finish executing.

i wondering whether possible innodb or other database engine (postgresql maybe?) read-only operations not block database performing rename table.

i imagine select continues read new table name if 2 operations happen concurrently.

[1] https://dev.mysql.com/doc/refman/5.0/en/rename-table.html

[2] https://dev.mysql.com/doc/refman/5.0/en/select.html


Comments