Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3664 search result indexing #3691

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Use natural key for HFJ_SEARCH_RESULT instead of PID
Search result caching is on the query hot-path.  We can use the natural composite key instead of the pid here.
  • Loading branch information
michaelabuckley committed Jun 9, 2022
commit da0d27aced2e49e03d7c919764617be371d87dfc
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,25 @@ public HapiFhirJpaMigrationTasks(Set<String> theFlags) {
init560(); // 20211027 -
init570(); // 20211102 -
init600(); // 20211102 -
init610();
}
michaelabuckley marked this conversation as resolved.
Show resolved Hide resolved

private void init610() {
Builder version = forVersion(VersionEnum.V6_1_0);

// use composite PK to avoid sequence traffic in hot path during query.
Builder.BuilderWithTableName searchResultTable = version.onTable("HFJ_SEARCH_RESULT");
searchResultTable
.dropIndex("20220609.1","HFJ_SEARCH_RESULT_PKEY");
searchResultTable
.dropColumn("20220609.2", "PID");
searchResultTable
.addIndex("20220609.3","HFJ_SEARCH_RESULT_PKEY")
.unique(true)
.withColumns("SEARCH_PID", "SEARCH_ORDER");
searchResultTable
.dropIndex("20220609.4","IDX_SEARCHRES_ORDER");
version.dropIdGenerator("20220609.", "SEQ_SEARCH_RES");
}

private void init600() {
Expand Down