src/hg/hgTracks/wigMafTrack.c 1.144

1.144 2009/08/24 23:07:54 hiram
Avoid thousands of describe tables on wigMaf summary tables on large chrom views
Index: src/hg/hgTracks/wigMafTrack.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTracks/wigMafTrack.c,v
retrieving revision 1.143
retrieving revision 1.144
diff -b -B -U 4 -r1.143 -r1.144
--- src/hg/hgTracks/wigMafTrack.c	15 Dec 2008 23:17:45 -0000	1.143
+++ src/hg/hgTracks/wigMafTrack.c	24 Aug 2009 23:07:54 -0000	1.144
@@ -1112,13 +1112,15 @@
     whereClause = where->string;
 sr = hOrderedRangeQuery(conn, summary, chromName, seqStart, seqEnd,
                         whereClause, &rowOffset);
 
+boolean hasFieldLeftStatus = hHasField(database, summary, "leftStatus");
+
 /* Loop through result creating a hash of lists of maf summary blocks.
  * The hash is keyed by species. */
 while ((row = sqlNextRow(sr)) != NULL)
     {
-    if (hHasField(database, summary, "leftStatus"))
+    if (hasFieldLeftStatus)
         ms = mafSummaryLoad(row + rowOffset);
     else
         /* previous table schema didn't have status fields */
         ms = mafSummaryMiniLoad(row + rowOffset);