My Java web-app that launches serveral sql scripts on startup, one of those scripts is a simple index creation on a foreign key.
CREATE INDEX "IDX_NAME" on "TABLE" ("IDFK") TABLESPACE "MYTBS"
Unfortunately my table has several million rows and the index creation holds the web-app in startup for a few hours (3 in this case).
Is there a way to create the index and populate it asynchronously?
答案 0 :(得分:1)
use online feature:
CREATE INDEX "IDX_NAME" on "TABLE" ("IDFK") TABLESPACE "MYTBS" online;