An online index rebuilding apparatus, comprising: a receiving module, configured to receive an online index rebuilding request, wherein the online index rebuilding request comprises an identifier of a data table; a lock processing module, configured to add, according to the online index rebuilding request, a schema shared lock to the data table corresponding to the identifier of the data table, wherein the lock processing module is further configured to obtain a latch and obtain a structure control right of the data table by using the latch; an entry address allocation module, configured to: after the lock processing module obtains the latch, reserve storage space of a shadow index for an original index of the data table, allocate an entry address of the shadow index, and add the entry address of the shadow index to a root page of the data table, wherein the root page comprises an entry address of an index of the data table, wherein the entry address of the index of the data table is the entry address of the original index; the lock processing module is further configured to release the latch after the entry address allocation module completes adding the entry address of the shadow index to the root page of the data table; a shadow index building module, configured to build the shadow index in the storage space of the shadow index according to data of the original index, wherein the lock processing module is further configured to obtain the latch again after the shadow index building module completes building the shadow index in the storage space of the shadow index; and an entry address processing module, configured to update the index entry address on the root page of the data table to the entry address of the shadow index after the lock processing module obtains the latch again, wherein the lock processing module is further configured to release the latch obtained again and the schema shared lock after the entry address processing module updates the index entry address on the root page of the data table to the entry address of the shadow index. a receiving module, configured to receive an online index rebuilding request, wherein the online index rebuilding request comprises an identifier of a data table; a lock processing module, configured to add, according to the online index rebuilding request, a schema shared lock to the data table corresponding to the identifier of the data table, wherein the lock processing module is further configured to obtain a latch and obtain a structure control right of the data table by using the latch; an entry address allocation module, configured to: after the lock processing module obtains the latch, reserve storage space of a shadow index for an original index of the data table, allocate an entry address of the shadow index, and add the entry address of the shadow index to a root page of the data table, wherein the root page comprises an entry address of an index of the data table, wherein the entry address of the index of the data table is the entry address of the original index; the lock processing module is further configured to release the latch after the entry address allocation module completes adding the entry address of the shadow index to the root page of the data table; a shadow index building module, configured to build the shadow index in the storage space of the shadow index according to data of the original index, wherein the lock processing module is further configured to obtain the latch again after the shadow index building module completes building the shadow index in the storage space of the shadow index; and an entry address processing module, configured to update the index entry address on the root page of the data table to the entry address of the shadow index after the lock processing module obtains the latch again, wherein the lock processing module is further configured to release the latch obtained again and the schema shared lock after the entry address processing module updates the index entry address on the root page of the data table to the entry address of the shadow index.