ui: overhaul track decider queries to make things faster

This CL overhauls a bunch of queries in track_decider to improve
load performance.

Specifically, the main thing we are doing is extracting a bunch of O(event)
queries into the standard library and compute a summary over each of the
event tables exactly once. This significantly reduces the amount of
redundant computation that needs to be performed.

Change-Id: I49c07f681c7128cf37852ad66a8a2a8e2e17b2b5
diff --git a/Android.bp b/Android.bp
index db1ef89..afcb092 100644
--- a/Android.bp
+++ b/Android.bp
@@ -12486,6 +12486,10 @@
         "src/trace_processor/perfetto_sql/stdlib/stack_trace/jit.sql",
         "src/trace_processor/perfetto_sql/stdlib/time/conversion.sql",
         "src/trace_processor/perfetto_sql/stdlib/v8/jit.sql",
+        "src/trace_processor/perfetto_sql/stdlib/viz/summary/processes.sql",
+        "src/trace_processor/perfetto_sql/stdlib/viz/summary/slices.sql",
+        "src/trace_processor/perfetto_sql/stdlib/viz/summary/threads.sql",
+        "src/trace_processor/perfetto_sql/stdlib/viz/summary/tracks.sql",
         "src/trace_processor/perfetto_sql/stdlib/wattson/arm_dsu.sql",
         "src/trace_processor/perfetto_sql/stdlib/wattson/cpu_freq.sql",
         "src/trace_processor/perfetto_sql/stdlib/wattson/cpu_idle.sql",