What I’m looking for is to return some estimate of row count, instead of the actual count which can be an expensive call. Similar to what you see in google search (… of about 1.000 rows).
Are there some out-of-the-box solutions for this? If not, what’s the general approach?
I’m querying Sql Server 2008 database.
EDIT: To clarify, the result count relates to certain user queries. For example, user searches for “John” and the result should be “There are about 1.280.000 rows that match John”
It’s hard to tell what you’re asking. If you’re talking about returning a number from a search algorithm, you could compute a hash from the inputs, and then use that hash to map against a count that you periodically maintain every so often. That might give you “about” the right results, depending on how good the hash is and how often you update your counts.