6327f6e56fb4615024546cae265f117c2c151320
tdreszer
  Fri May 31 17:27:33 2013 -0700
Three changes to attempt to recover from mysql performace degradation (ref #10910).  1. Added index to val.  2. Replaced subqueries with joins.  3. Replaced ORDER BY query with in code sort.
diff --git src/hg/lib/metaDb.sql src/hg/lib/metaDb.sql
index 8eb807f..be3c837 100644
--- src/hg/lib/metaDb.sql
+++ src/hg/lib/metaDb.sql
@@ -1,14 +1,10 @@
-# metaDb.sql was originally generated by the autoSql program, which also
-# generated metaDb.c and metaDb.h.  This creates the database representation of
-# an object which can be loaded and saved from RAM in a fairly
-# automatic way.
-
 #This contains metadata for a table, file or other predeclared object type.
 CREATE TABLE metaDb (
     obj varchar(255) not null,	        # Object name or ID.
     var varchar(255) not null,	        # Metadata variable name.
-    val longblob not null,	        # Metadata value.
+    val varchar(2048) not null,	        # Metadata value.
               #Indices
     PRIMARY KEY(obj,var),
-    UNIQUE(var,val(32),obj)
+    INDEX varKey (var),
+    INDEX valKey (val(64))
 );
