Given a table and an index, this function takes a random sample of the index, with the first key part equal to the third argument, the second equal to the fourth argument and so on. If only the table and index are given, the returned value is the approximate count of the entire index.
Normal cast rules are applied to convert the arguments to the types of the corresponding key parts. If the cast fails, -1 is returned.
The estimates are typically within 10% of the real count. If there have been random deletions or inserts leading to uneven page filling or if index entries are of greatly varying $ length, the estimates may be less precise.
Key_estimate returns the approximate count of entries in the index with the specified values in the leading key parts. -1 if cannot be determined.