Permalink
Browse files

ds/am: disabled SQL query caching during profiling, sorted by duratio…

…n as 2nd criterion, misc ui improvements
  • Loading branch information...
1 parent c50938f commit 5ab0dd729ce85298bf43a1f3b2ea2f2e6d602e09 @dsboulder dsboulder committed May 8, 2008
@@ -41,6 +41,7 @@ def delete_with_review(sql, *args)
end
def select_with_review(sql, *args)
+ sql.gsub!(/^SELECT /i, "SELECT SQL_NO_CACHE ")
@logger.silence { execute("SET PROFILING=1") } if QueryReviewer::CONFIGURATION["profiling"]
t1 = Time.now
query_results = select_without_review(sql, *args)
@@ -85,6 +85,10 @@ div.query_review_details code {
line-height: 120%;
}
+div.query_review_details table.explain th {
+ cell-padding: 5px;
+}
+
div.query_review_details .title {
font-weight: bold;
}
@@ -187,15 +191,15 @@ div.query_review_details tr {
}
div.query_review_details td {
- border: 0px;
- padding: 0px;
+ border: 1px solid gray;
+ padding: 3px;
margin: 0px;
overflow: hidden;
}
div.query_review_details th {
- border-bottom: 1px solid gray;
- padding: 0px;
+ border: 1px solid gray;
+ padding: 3px;
margin: 0px;
}
@@ -1,4 +1,4 @@
-<table>
+<table class="explain">
<thead>
<tr>
<th>table</th>
@@ -54,7 +54,7 @@ def queries_with_warnings
end
def queries_with_warnings_sorted
- queries_with_warnings.sort{|a,b| a.max_severity <=> b.max_severity}.reverse
+ queries_with_warnings.sort{|a,b| (b.max_severity * 1000 + (b.duration || 0)) <=> (a.max_severity * 1000 + (a.duration || 0))}
end
def queries_with_warnings_sorted_nonignored

0 comments on commit 5ab0dd7

Please sign in to comment.