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/lib/cartTrackDb.c src/hg/lib/cartTrackDb.c
index 3efab84..2a50696 100644
--- src/hg/lib/cartTrackDb.c
+++ src/hg/lib/cartTrackDb.c
@@ -380,31 +380,31 @@
 struct slName *cartTrackDbTablesForTrack(char *db, struct trackDb *track, boolean useJoiner)
 /* Return list of all tables associated with track.  If useJoiner, the result can include
  * non-positional tables that are related to track by all.joiner. */
 {
 static struct joiner *allJoiner = NULL;
 struct hash *uniqHash = newHash(8);
 struct slName *name, *nameList = NULL;
 char *trackTable = track->table;
 
 hashAdd(uniqHash, trackTable, NULL);
 if (useJoiner)
     {
     if (allJoiner == NULL)
         allJoiner = joinerRead("all.joiner");
     struct joinerPair *jpList, *jp;
-    jpList = joinerRelate(allJoiner, db, trackTable);
+    jpList = joinerRelate(allJoiner, db, trackTable, db);
     for (jp = jpList; jp != NULL; jp = jp->next)
 	{
 	struct joinerDtf *dtf = jp->b;
 	if (cartTrackDbIsAccessDenied(dtf->database, dtf->table))
 	    continue;
 	char buf[256];
 	char *s;
 	if (sameString(dtf->database, db))
 	    s = dtf->table;
 	else
 	    {
 	    safef(buf, sizeof(buf), "%s.%s", dtf->database, dtf->table);
 	    s = buf;
 	    }
 	if (!hashLookup(uniqHash, s))