3a149415fde399e02345bf9fcbf8aadd0f0c1baa
tdreszer
Fri Feb 25 10:12:30 2011 -0800
File search can get terribly slow with too many files. Limit to 1000.
diff --git src/hg/lib/fileUi.c src/hg/lib/fileUi.c
index 2ae0a26..70662ab 100644
--- src/hg/lib/fileUi.c
+++ src/hg/lib/fileUi.c
@@ -669,81 +669,85 @@
struct sqlConnection *connLocal = conn;
if (conn == NULL)
connLocal = hAllocConn(db);
struct mdbObj *mdbList = mdbObjRepeatedSearch(connLocal,varValPairs,FALSE,TRUE);
if (conn == NULL)
hFreeConn(&connLocal);
if (slCount(mdbList) == 0)
{
printf("
");
-int filesCount = filesPrintTable(db,NULL,fileList,sortOrder);
+if (mdbList != NULL)
+ {
+ printf("
Too many files found. Displaying first %d of potentially %d.
Narrow search parameters and try again.
\n",
+ fileCount,(fileCount+slCount(mdbList)*2)); // Multiply*2 because of fileIndexes
+ //warn("Too many files found. Displaying first %d of potentially %d.
Narrow search parameters and try again.\n", fileCount,(fileCount+slCount(mdbList)*2)); // Multiply because of fileIndexes
+ mdbObjsFree(&mdbList);
+ }
+
+fileCount = filesPrintTable(db,NULL,fileList,sortOrder);
printf("