d8be7e6e88c0712589dac72c1f023c84028a0d1c
angie
  Wed Feb 7 11:49:17 2018 -0800
To prevent joinerRoute from searching over all databases for routes from some genome db to hgFixed metadata tables, add a new optional arg to joinerRelate to apply joinerExclusiveCheck to the genome db in addition to the current table's database.
This reduces the time to find the route hg19.refSeqAli --> hgFixed.gbCdnaInfo --> hgFixed.cds from ~1.5s to ~0.1s.  It also keeps the related-table selection in hgTables and hgIntegrator from showing >5000 related tables when starting with a genome db table and adding hgFixed.gbCdnaInfo.
refs #20949

diff --git src/hg/inc/joiner.h src/hg/inc/joiner.h
index 5c43a7e..a2022e4 100644
--- src/hg/inc/joiner.h
+++ src/hg/inc/joiner.h
@@ -161,33 +161,34 @@
     struct joinerSet *identifier;	/* Identifier this is based on,
                                          * not allocated here. */
     struct joinerPair *child;   /* Optional tree structure for representing hierarchical routes. */
     };
 
 void joinerPairFree(struct joinerPair **pJp);
 /* Free up memory associated with joiner pair. */
 
 void joinerPairFreeList(struct joinerPair **pList);
 /* Free up memory associated with list of joinerPairs. */
 
 void joinerPairDump(struct joinerPair *jpList, FILE *out);
 /* Write out joiner pair list to file mostly for debugging. */
 
 struct joinerPair *joinerRelate(struct joiner *joiner, char *database, 
-	char *table);
+                                char *table, char *exclusiveDb);
 /* Get list of all ways to link table in given database to other tables,
- * possibly in other databases. */
+ * possibly in other databases.
+ * If exclusiveDb is not NULL then apply joinerExclusiveCheck to it in addition to database. */
 
 struct slRef *joinerSetInheritanceChain(struct joinerSet *js);
 /* Return list of self, children, and parents (but not siblings).
  * slFreeList result when done. */
 
 struct joinerField *joinerSetFindField(struct joinerSet *js, struct joinerDtf *dtf);
 /* Find field in set if any that matches dtf */
 
 boolean joinerDtfSameTable(struct joinerDtf *a, struct joinerDtf *b);
 /* Return TRUE if they are in the same database and table. */
 
 boolean joinerDtfAllSameTable(struct joinerDtf *fieldList);
 /* Return TRUE if all joinerPairs refer to same table. */
 
 struct joinerPair *joinerFindRoute(struct joiner *joiner,