MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Join_tab_compare_default Class Reference

#include <sql_select.h>

Public Member Functions

bool operator() (const JOIN_TAB *jt1, const JOIN_TAB *jt2)

Detailed Description

"Less than" comparison function object used to compare two JOIN_TAB objects based on a number of factors in this order:

  • table before another table that depends on it (straight join, outer join etc), then
  • table before another table that depends on it to use a key as access method, then
  • table with smallest number of records first, then
  • the table with lowest-value pointer (i.e., the one located in the lowest memory address) first.
Parameters
jt1first JOIN_TAB object
jt2second JOIN_TAB object
Note
The order relation implemented by Join_tab_compare_default is not transitive, i.e. it is possible to choose a, b and c such that (a < b) && (b < c) but (c < a). This is the case in the following example:

a: dependent = <none> found_records = 3 b: dependent = <none> found_records = 4 c: dependent = b found_records = 2

a < b: because a has fewer records b < c: because c depends on b (e.g outer join dependency) c < a: because c has fewer records

This implies that the result of a sort using the relation implemented by Join_tab_compare_default () depends on the order in which elements are compared, i.e. the result is implementation-specific.

Returns
true if jt1 is smaller than jt2, false otherwise

Definition at line 1017 of file sql_select.h.


The documentation for this class was generated from the following file: