remove upload_pk from query in countPlainFiles() when it is not needed (in uploadtree_nnnn tables).  This speeds up the query some.