Bug 1194023 - Part 1: Filter out warnings about sort operations on CREATE INDEX statements. r=mak
authorEric Rahm <erahm@mozilla.com>
Fri, 25 Sep 2015 15:27:48 -0700
changeset 265427 5ecfe1c78e636cd12fe68115917b5a5aeb256a88
parent 265426 5fdaa2145a9da6f7ec3ff3370e7b48fffa3f54ad
child 265428 9009233203a765d35131df7da70bc7373eb2c9f1
push id15457
push usercbook@mozilla.com
push dateThu, 01 Oct 2015 12:17:04 +0000
treeherderfx-team@2cfe7f844083 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1194023
milestone44.0a1
Bug 1194023 - Part 1: Filter out warnings about sort operations on CREATE INDEX statements. r=mak
storage/mozStoragePrivateHelpers.cpp
--- a/storage/mozStoragePrivateHelpers.cpp
+++ b/storage/mozStoragePrivateHelpers.cpp
@@ -89,16 +89,21 @@ checkAndLogStatementPerformance(sqlite3_
     return;
 
   const char *sql = ::sqlite3_sql(aStatement);
 
   // Check to see if this is marked to not warn
   if (::strstr(sql, "/* do not warn (bug "))
     return;
 
+  // CREATE INDEX always sorts (sorting is a necessary step in creating
+  // an index).  So ignore the warning there.
+  if (::strstr(sql, "CREATE INDEX") || ::strstr(sql, "CREATE UNIQUE INDEX"))
+    return;
+
   nsAutoCString message("Suboptimal indexes for the SQL statement ");
 #ifdef MOZ_STORAGE_SORTWARNING_SQL_DUMP
   message.Append('`');
   message.Append(sql);
   message.AppendLiteral("` [");
   message.AppendInt(count);
   message.AppendLiteral(" sort operation(s)]");
 #else