Add FK index to avoid timeout when deleting large ValueSet (#3416)
* Add FK index to avoid timeout when deleting large ValueSet * Add exception to allow same name for index and FK Co-authored-by: juan.marchionatto <juan.marchionatto@smilecdr.com>
This commit is contained in:
parent
96cadbba3e
commit
53c5a9bbeb
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
type: fix
|
||||
issue: 3316
|
||||
title: "When deleting a large ValueSet operation was timing out. This issue has been fixed."
|
|
@ -84,7 +84,8 @@ public class TestUtil {
|
|||
"FK_CONCEPTPROP_CONCEPT",
|
||||
"FK_CONCEPTDESIG_CONCEPT",
|
||||
"FK_TERM_CONCEPTPC_CHILD",
|
||||
"FK_TERM_CONCEPTPC_PARENT"
|
||||
"FK_TERM_CONCEPTPC_PARENT",
|
||||
"FK_TRM_VALUESET_CONCEPT_PID"
|
||||
);
|
||||
|
||||
|
||||
|
|
|
@ -33,7 +33,10 @@ import java.io.Serializable;
|
|||
import static org.apache.commons.lang3.StringUtils.left;
|
||||
import static org.apache.commons.lang3.StringUtils.length;
|
||||
|
||||
@Table(name = "TRM_VALUESET_C_DESIGNATION")
|
||||
@Table(name = "TRM_VALUESET_C_DESIGNATION", indexes = {
|
||||
// must have same name that indexed FK or SchemaMigrationTest complains because H2 sets this index automatically
|
||||
@Index(name = "FK_TRM_VALUESET_CONCEPT_PID", columnList = "VALUESET_CONCEPT_PID", unique = false)
|
||||
})
|
||||
@Entity()
|
||||
public class TermValueSetConceptDesignation implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
|
|
@ -153,6 +153,15 @@ public class HapiFhirJpaMigrationTasks extends BaseMigrationTasks<VersionEnum> {
|
|||
// drop obsolete
|
||||
dateTable.dropIndexOnline("20220207.16", "IDX_SP_DATE_UPDATED");
|
||||
|
||||
// fix for https://github.com/hapifhir/hapi-fhir/issues/3316
|
||||
// index must have same name that indexed FK or SchemaMigrationTest complains because H2 sets this index automatically
|
||||
|
||||
version.onTable("TRM_VALUESET_C_DESIGNATION")
|
||||
.addIndex("20220223.1", "FK_TRM_VALUESET_CONCEPT_PID")
|
||||
.unique(false)
|
||||
.withColumns("VALUESET_CONCEPT_PID")
|
||||
.onlyAppliesToPlatforms(NON_AUTOMATIC_FK_INDEX_PLATFORMS);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue