added limit clause to getnumtuplerecs to
see if it speeds up the query.