Added index to improve the performance (#2385)
* Added index to improve the performance * Added index for FORCED_ID * Added comments for the index of while 'missing' is supported. * Updated comments * Moved the migration script to V5_4_0
This commit is contained in:
parent
f752e46e84
commit
85824efa51
|
@ -608,6 +608,11 @@ public class DaoConfig {
|
|||
* <code>_sort</code> parameter on searches): If the server is configured
|
||||
* to not index missing field.
|
||||
* </p>
|
||||
* <p>
|
||||
* The following index may need to be added into the indexed tables such as <code>HFJ_SPIDX_TOKEN</code>
|
||||
* to improve the search performance while <code>:missing</code> is enabled.
|
||||
* <code>RES_TYPE, SP_NAME, SP_MISSING</code>
|
||||
* </p>
|
||||
*/
|
||||
public void setIndexMissingFields(IndexEnabledEnum theIndexMissingFields) {
|
||||
Validate.notNull(theIndexMissingFields, "theIndexMissingFields must not be null");
|
||||
|
|
|
@ -72,6 +72,20 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks<VersionEnum> {
|
|||
init510(); // 20200516 - 20201028
|
||||
init520(); // 20201029 -
|
||||
init530();
|
||||
init540(); // 20210218 -
|
||||
}
|
||||
|
||||
private void init540() {
|
||||
|
||||
Builder version = forVersion(VersionEnum.V5_4_0);
|
||||
|
||||
//-- add index on HFJ_SPIDX_DATE
|
||||
version.onTable("HFJ_SPIDX_DATE").addIndex("20210309.1", "IDX_SP_DATE_HASH_HIGH")
|
||||
.unique(false).withColumns("HASH_IDENTITY", "SP_VALUE_HIGH");
|
||||
|
||||
//-- add index on HFJ_FORCED_ID
|
||||
version.onTable("HFJ_FORCED_ID").addIndex("20210309.2", "IDX_FORCEID_FID")
|
||||
.unique(false).withColumns("FORCED_ID");
|
||||
}
|
||||
|
||||
private void init530() {
|
||||
|
@ -126,6 +140,7 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks<VersionEnum> {
|
|||
// HFJ_RES_LINK
|
||||
version.onTable("HFJ_RES_LINK")
|
||||
.addColumn("20210126.1", "TARGET_RESOURCE_VERSION").nullable().type(ColumnTypeEnum.LONG);
|
||||
|
||||
}
|
||||
|
||||
protected void init520() {
|
||||
|
|
|
@ -31,6 +31,7 @@ import javax.persistence.ForeignKey;
|
|||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Index;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.OneToOne;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
|
@ -48,6 +49,7 @@ import javax.persistence.UniqueConstraint;
|
|||
* - IDX_FORCEDID_TYPE_RESID
|
||||
* so don't reuse these names
|
||||
*/
|
||||
@Index(name = "IDX_FORCEID_FID", columnList = "FORCED_ID")
|
||||
})
|
||||
public class ForcedId extends BasePartitionable {
|
||||
|
||||
|
|
|
@ -55,6 +55,7 @@ import java.util.Date;
|
|||
// We previously had an index called IDX_SP_DATE - Dont reuse
|
||||
@Index(name = "IDX_SP_DATE_HASH", columnList = "HASH_IDENTITY,SP_VALUE_LOW,SP_VALUE_HIGH"),
|
||||
@Index(name = "IDX_SP_DATE_HASH_LOW", columnList = "HASH_IDENTITY,SP_VALUE_LOW"),
|
||||
@Index(name = "IDX_SP_DATE_HASH_HIGH", columnList = "HASH_IDENTITY,SP_VALUE_HIGH"),
|
||||
@Index(name = "IDX_SP_DATE_ORD_HASH", columnList = "HASH_IDENTITY,SP_VALUE_LOW_DATE_ORDINAL,SP_VALUE_HIGH_DATE_ORDINAL"),
|
||||
@Index(name = "IDX_SP_DATE_ORD_HASH_LOW", columnList = "HASH_IDENTITY,SP_VALUE_LOW_DATE_ORDINAL"),
|
||||
@Index(name = "IDX_SP_DATE_RESID", columnList = "RES_ID"),
|
||||
|
|
Loading…
Reference in New Issue