AutoTune update - rename and profiling against original query

This commit is contained in:
Robin Bygrave committed 2015-09-10 00:17:49 +12:00
1 parent 116cc3a3fe
commit 71dd0e5728
15 files changed
+322 -268

No files matched your search

@@ -81,7 +81,7 @@ public class OrmQueryDetail implements Serializable {
}
/**
* Return true if equal in terms of autofetch (select and joins).
* Return true if equal in terms of autoTune (select and fetch).
*/
public boolean isAutoTuneEqual(OrmQueryDetail otherDetail) {
@@ -91,6 +91,9 @@ public class OrmQueryDetail implements Serializable {
if (fetchPaths == null) {
return otherDetail.fetchPaths == null;
}
if (fetchPaths.size() != otherDetail.fetchPaths.size()) {
return false;
}
Set<Map.Entry<String, OrmQueryProperties>> entries = fetchPaths.entrySet();
for (Map.Entry<String, OrmQueryProperties> entry : entries) {
OrmQueryProperties chunk = otherDetail.getChunk(entry.getKey(), false);
@@ -100,7 +103,6 @@ public class OrmQueryDetail implements Serializable {
}
return true;
//return autofetchPlanHash() == otherDetail.autofetchPlanHash();
}
private boolean isSame(OrmQueryProperties p1, OrmQueryProperties p2) {
@@ -110,22 +112,6 @@ public class OrmQueryDetail implements Serializable {
return p1.isSame(p2);
}
// /**
// * Calculate the hash for the query plan.
// */
// private int autofetchPlanHash() {
//
// int hc = (baseProps == null ? 1 : baseProps.autofetchPlanHash());
//
// if (fetchPaths != null) {
// for (OrmQueryProperties p : fetchPaths.values()) {
// hc = hc * 31 + p.autofetchPlanHash();
// }
// }
//
// return hc;
// }
public String toString() {
StringBuilder sb = new StringBuilder();
if (baseProps != null) {
@@ -236,7 +222,7 @@ public class OrmQueryDetail implements Serializable {
boolean tuned = false;
OrmQueryProperties tunedRoot = tunedDetail.getChunk(null, false);
if (tunedRoot != null && tunedRoot.hasProperties()) {
if (tunedRoot != null) {
tuned = true;
baseProps.setTunedProperties(tunedRoot);