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 265407 5ecfe1c78e636cd12fe68115917b5a5aeb256a88
parent 265406 5fdaa2145a9da6f7ec3ff3370e7b48fffa3f54ad
child 265408 9009233203a765d35131df7da70bc7373eb2c9f1
push id29462
push usercbook@mozilla.com
push dateThu, 01 Oct 2015 10:39:47 +0000
treeherdermozilla-central@2c1fb007137d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1194023
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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