Permalink
Browse files

0002956: getFullyQualifiedTableName is a CPU hotspot

  • Loading branch information...
1 parent 4b58765 commit 031d247541f21de28a9fa0057babbcaf860efb75 @chenson42 chenson42 committed Jan 9, 2017
Showing with 10 additions and 5 deletions.
  1. +10 −5 symmetric-db/src/main/java/org/jumpmind/db/model/Table.java
@@ -1006,7 +1006,7 @@ public String getQualifiedColumnName(Column column) {
}
public static String getFullyQualifiedTablePrefix(String catalogName, String schemaName) {
- return getFullyQualifiedTablePrefix(catalogName, schemaName, null, ".", ".");
+ return getFullyQualifiedTablePrefix(new StringBuilder(), catalogName, schemaName, null, ".", ".");
}
public String getQualifiedTableName(String quoteString, String catalogSeparator, String schemaSeparator) {
@@ -1022,14 +1022,19 @@ public static String getFullyQualifiedTableName(String catalogName, String schem
if (quoteString == null) {
quoteString = "";
}
- StringBuilder sb = new StringBuilder(getFullyQualifiedTablePrefix(catalogName, schemaName, quoteString, catalogSeparator, schemaSeparator));
+ StringBuilder sb = new StringBuilder();
+ getFullyQualifiedTablePrefix(sb, catalogName, schemaName, quoteString, catalogSeparator, schemaSeparator);
sb.append(quoteString).append(tableName).append(quoteString);
return sb.toString();
}
-
+
public static String getFullyQualifiedTablePrefix(String catalogName, String schemaName,
String quoteString, String catalogSeparator, String schemaSeparator) {
- StringBuilder sb = new StringBuilder();
+ return getFullyQualifiedTablePrefix(new StringBuilder(), catalogName, schemaName, quoteString, catalogSeparator, schemaSeparator);
+ }
+
+ public static String getFullyQualifiedTablePrefix(StringBuilder sb, String catalogName, String schemaName,
+ String quoteString, String catalogSeparator, String schemaSeparator) {
if (quoteString == null) {
quoteString = "";
}
@@ -1043,7 +1048,7 @@ public static String getFullyQualifiedTablePrefix(String catalogName, String sch
}
public String getQualifiedTablePrefix(String quoteString, String catalogSeparator, String schemaSeparator) {
- return getFullyQualifiedTablePrefix(catalog, schema, quoteString, catalogSeparator, schemaSeparator);
+ return getFullyQualifiedTablePrefix(new StringBuilder(), catalog, schema, quoteString, catalogSeparator, schemaSeparator);
}
public Column getColumnWithName(String name) {

0 comments on commit 031d247

Please sign in to comment.