Skip to content

Commit

Permalink
#26926 include in 22.03.13
Browse files Browse the repository at this point in the history
  • Loading branch information
erickgonzalez committed Jan 2, 2024
1 parent e8ff884 commit 03ab9a5
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.dotmarketing.startup.runonce;

import com.dotmarketing.common.db.DotConnect;
import com.dotmarketing.exception.DotDataException;
import com.dotmarketing.exception.DotRuntimeException;
import com.dotmarketing.startup.StartupTask;

/**
* This upgrade task adds "left" indexes to on the inode.inode and the identifier.id columns. This
* GREATLY speeds up queries that use `like 'param%'` clauses in their queries, where we only wildcard
* on the right hand side.
*/
public class Task231207AddInodeAndIdentifierLeftIndexes implements StartupTask {

@Override
public boolean forceRun() {
return true;
}

@Override
public void executeUpgrade() throws DotDataException, DotRuntimeException {
new DotConnect().setSQL("CREATE INDEX if not exists inode_inode_leading_idx ON inode(inode COLLATE \"C\");").loadResult();

new DotConnect().setSQL("CREATE INDEX if not exists identifier_id_leading_idx ON identifier(id COLLATE \"C\");").loadResult();

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ public static List<Class<?>> getBackportedUpgradeTaskClasses() {
ret.add(Task230119MigrateContentToProperPersonaTagAndRemoveDupTags.class);
ret.add(Task230426AlterVarcharLengthOfLockedByCol.class);
ret.add(Task230713IncreaseDisabledWysiwygColumnSize.class);
ret.add(Task231207AddInodeAndIdentifierLeftIndexes.class);
return ret.stream().sorted(classNameComparator).collect(Collectors.toList());
}

Expand Down
3 changes: 2 additions & 1 deletion hotfix_tracking.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,5 @@ This maintenance release includes the following code fixes:
**Release-22.03.13**

187. https://github.com/dotCMS/core/issues/26970 : GraphQL Cache not working #26970
188. https://github.com/dotCMS/core/issues/26934 : Add Catalina Log Back #26934
188. https://github.com/dotCMS/core/issues/26934 : Add Catalina Log Back #26934
189. https://github.com/dotCMS/core/issues/26926 : Add left indexes to inode.inode and identifier.id #26926

0 comments on commit 03ab9a5

Please sign in to comment.