Documentation Home
MySQL Internals Manual


MySQL Internals Manual  /  ...  /  records_in_range

23.18.20 records_in_range

Purpose

For the given range how many records are estimated to be in this range.

Synopsis

virtual ha_rows records_in_range (

inx,

min_key,

max_key);

uint

inx ;

key_range *

min_key ;

key_range *

max_key ;

Description

This is the records_in_range method.

Given a starting key, and an ending key estimate the number of rows that will exist between the two. end_key may be empty which in case determine if start_key matches any rows.

Used by optimizer to calculate cost of using a particular index.

Called from opt_range.cc by check_quick_keys().

Parameters

  • inx

  • min_key

  • max_key

Return Values

Return the approxamite number of rows.

Usage

Determine an approxamite count of the rows between the key values and return.

Default Implementation

 { return (ha_rows) 10; }

User Comments
User comments in this section are, as the name implies, provided by MySQL users. The MySQL documentation team is not responsible for, nor do they endorse, any of the information provided here.
Sign Up Login You must be logged in to post a comment.