# US 2016/0259692 A1 · Method for optimizing index, master database node and subscriber database node

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2016/0259692 A1
- Document ID: US20160259692A1
- Status: Published application
- Kind: A1
- Application number: 15/158,279
- Filed: 2016-05-18
- Published: 2016-09-08
- Earliest claimed: 2013-11-19
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Prasanna Venkatesh RAMAMURTHI; Vamsi KRISHNA; Mahesh Kumar BEHERA
- Web page: https://patentgrep.com/patent/US20160259692A1

## CPC

- G06F 11/1451: {by selection of backup contents}
- G06F 16/22: Indexing; Data structures therefor; Storage structures
- G06F 16/2272: {Management thereof}
- G06F 16/27: Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
- G06F 16/2358: {Change logging, detection, and notification (replication G06F16/27)}
- G06F 2201/80: Database-specific techniques
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method, a master database node and a subscriber database node for optimizing index. The method for optimizing index includes: checking, by a master database node, if role information of an index matches role information of the master database node, when the index is added into the master database node; updating database information by using the index when the role information of the index matches the role information of the master database node. In this invention, unnecessary indexes in the master database node and the subscriber database node are reduced while keeping the schema the same. Furthermore, unnecessary logs transmitted from the master database node to the subscriber database node are reduced.

## Claims

### Claim 1

A method for optimizing index, comprising:
checking, by a master database node, if role information of an index matches role information of the master database node, when the index is added into the master database node;
updating, by the master database node, database information by using the index when the role information of the index matches the role information of the master database node.

### Claim 2 (depends on 1)

The method as claimed in claim 1, wherein before checking if role information of a index matches role information of the master database node, the method further comprises:
adding the role information for the master database node.

### Claim 3 (depends on 1)

The method as claimed in claim 1, wherein before checking if role information of an index matches role information of the master database node, the method further comprises:
creating the index by using Data Definition Language;
updating the index with the role information.

### Claim 4 (depends on 1)

The method as claimed in claim 1, wherein the method further comprises:
checking, by the master database node, if the role information of the index matches the role information of a subscriber database node;
sending, by the master database node, the index to the subscriber database node when the role information of the index matches the role information of the subscriber database node, so as to synchronize the index with the subscriber database node.

### Claim 5 (depends on 4)

The method as claimed in claim 4, wherein the method further comprises:
receiving, by the master database node, the role information of the subscriber database node.

### Claim 6 (depends on 1)

The method as claimed in claim 1, wherein the method further comprises:
checking, by the master database node, if the role information of the index matches the role information of the master database node, when a record need to be inserted into a table associated with the index;
generating dummy redo information for the record when the role information of the index does not match the role information of the master database node.

### Claim 7 (depends on 6)

The method as claimed in claim 6, wherein the method further comprises:
checking, by the master database node, if the role information of the index matches the role information of a subscriber database node;
sending, by the master database node, the dummy redo information to the subscriber database node when the role information of the index matches the role information of the subscriber database node.

### Claim 8 (depends on 6)

The method as claimed in claim 6, wherein when the role information of the index matches the role information of the master database node, the method further comprises:
inserting, by the master database node, the record into the table associated with the index;
generating redo information for the record.

### Claim 9 (depends on 8)

The method as claimed in claim 8, wherein the method further comprises:
checking, by the master database node, if the role information of the index matches the role information of a subscriber database node:
sending, by the master database node, the redo information to the subscriber database node when the role information of the index matches the role information of the subscriber database node.

### Claim 10 (depends on 1)

The method as claimed in claim 1, wherein the method further comprises:
checking, by the master database node, if the role information of the index matches updated role information of the master database node, when the role information of the master database node is updated;
populating, by the master database node, the index when the role information of the index matches the updated role information of the master database node.

### Claim 11

A method for optimizing index, comprising:
updating, by a subscriber database node, role information of the subscriber database node when the subscriber database node is added into a cluster containing a master database node;
sending, by the subscriber database node, the role information of the subscriber database node to the master database node.

### Claim 12 (depends on 11)

The method as claimed in claim 11, wherein the method further comprises:
receiving, by the subscriber database node, an index from the master database node;
synchronizing the index with the master database node.

### Claim 13 (depends on 11)

The method as claimed in claim 11, wherein the method further comprises:
receiving, by the subscriber database node, redo information from the master database node;
updating relevant segment based on the redo information, when the redo information is index redo information.

### Claim 14 (depends on 13)

The method as claimed in claim 13, wherein the method further comprises:
updating the index with the redo information, when the redo information is not index redo information and not dummy redo information.

### Claim 15 (depends on 13)

The method as claimed in claim 13, wherein the method further comprises:
generating index data and updating the index according to the redo information, when the redo information is not index redo information and is dummy redo information.

### Claim 16 (depends on 11)

The method as claimed in claim 11, wherein the method further comprises:
checking, by the subscriber database node, if the role information of the index matches updated role information of the subscriber database node, when the role information of the subscriber database node is updated;
populating, by the subscriber database node, the index when the role information of the index matches the updated role information of the subscriber database node.

### Claim 17 (depends on 16)

The method as claimed in claim 16, wherein the method further comprises:
truncating, by the subscriber database node, the index when the role information of the index does not match the updated role information of the subscriber database node.

### Claim 18

A master database node, comprising:
a processor;
a memory storing computer program which are reading by the processor to cause the processor to perform the following steps;
checking if role information of an index matches role information of the master database node, when the index is added into the master database node;
updating database information by using the index when the role information of the index matches the role information of the master database node.

### Claim 19 (depends on 18)

The master database node according to claim 18, wherein the processor further performs the following steps:
checking if the role information of the index matches the role information of a subscriber database node;
sending the index to the subscriber database node when the role information of the index matches the role information of the subscriber database node, so as to synchronize the index with the subscriber database node.

### Claim 20

A subscriber database node, comprising:
a processor;
a memory storing computer program which are reading by the processor to cause the processor to perform the following steps:
updating role information of the subscriber database node when the subscriber database node is added into a cluster containing a master database node;
sending the role information of the subscriber database node to the master database node.
