Disable and rebuild an index in HSQLDB

泄露秘密 提交于 2019-12-10 11:41:21

问题


I would like to disable (and later rebuild) all indexes for a given table in an HSQLDB. I know this feature from SQL Server, where you can just write

ALTER INDEX ALL ON MyTable DISABLE;

to disable all indexes for a table and then rebuild them with

ALTER INDEX ALL ON MyTable REBUILD;

I am not even sure, if HSQLDB supports disabling and enabling a single index.


回答1:


HSQLDB does not have this feature.

You can perform SHUTDOWN COMPACT to recreate all indexes on all tables.




回答2:


I do not think this is indeed supported. However you can drop index and then create it again. Something like this:

DROP INDEX index [IF EXISTS];
ALTER TABLE MY_TABLE ADD INDEX MY_INDEX

Take a look on this doc for more info.



来源:https://stackoverflow.com/questions/12567327/disable-and-rebuild-an-index-in-hsqldb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!