24#ifndef FILESORT_INCLUDED
25#define FILESORT_INCLUDED
79 bool force_sort_rowids,
bool unwrap_rollup);
82 uint *plength,
uint *ppackable_length);
115template <
bool Is_big_endian>
125#ifdef WORDS_BIGENDIAN
126 constexpr bool Is_big_endian =
true;
128 constexpr bool Is_big_endian =
false;
130 copy_integer<Is_big_endian>(to, to_length,
131 static_cast<uchar *
>(
static_cast<void *
>(&val)),
This class wraps information about usage of addon fields.
Definition: sort_param.h:129
A class wrapping misc buffers used for sorting.
Definition: sql_sort.h:189
Sorting related info.
Definition: filesort.h:52
st_sort_field * sortorder
ORDER BY list with some precalculated info for filesort.
Definition: filesort.h:63
uint make_sortorder(ORDER *order, bool unwrap_rollup)
Definition: filesort.cc:674
Addon_fields * get_addon_fields(Addon_fields_status *addon_fields_status, uint *plength, uint *ppackable_length)
Get descriptors of fields appended to sorted fields and calculate their total length.
Definition: filesort.cc:2257
bool using_pq
true means we are using Priority Queue for order by with limit.
Definition: filesort.h:65
ha_rows limit
Maximum number of rows to return.
Definition: filesort.h:61
bool m_remove_duplicates
Definition: filesort.h:66
Mem_root_array< TABLE * > tables
The tables we are sorting.
Definition: filesort.h:56
uint m_sort_order_length
Definition: filesort.h:101
bool m_force_sort_rowids
Definition: filesort.h:70
THD * m_thd
Definition: filesort.h:54
const bool keep_buffers
If true, do not free the filesort buffers (use if you expect to sort many times, like in an uncacheab...
Definition: filesort.h:59
Filesort(THD *thd, Mem_root_array< TABLE * > tables, bool keep_buffers, ORDER *order, ha_rows limit_arg, bool remove_duplicates, bool force_sort_rowids, bool unwrap_rollup)
Definition: filesort.cc:660
uint sort_order_length() const
Definition: filesort.h:85
Sort_param m_sort_param
Definition: filesort.h:72
bool using_addon_fields()
Whether we are using addon fields (sort entire rows) or not (sort row IDs).
Definition: filesort.cc:2376
void clear_addon_fields()
Reset the decision made in using_addon_fields().
Definition: filesort.cc:2384
Definition: sql_optimizer.h:133
A typesafe replacement for DYNAMIC_ARRAY.
Definition: mem_root_array.h:426
A context for reading through a single table using a chosen access method: index read,...
Definition: row_iterator.h:82
There are several record formats for sorting:
Definition: sort_param.h:302
Definition: sql_sort.h:156
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:34
void filesort_free_buffers(TABLE *table, bool full)
Definition: filesort.cc:640
void copy_integer(uchar *to, size_t to_length, const uchar *from, size_t from_length, bool is_unsigned)
Copies an integer value to a format comparable with memcmp().
Definition: field.h:452
bool SortWillBeOnRowId(const TABLE *table)
Definition: filesort.cc:2186
bool filesort(THD *thd, Filesort *filesort, RowIterator *source_iterator, table_map tables_to_get_rowid_for, ha_rows num_rows_estimate, Filesort_info *fs_info, Sort_result *sort_result, ha_rows *found_rows)
Sort a table.
Definition: filesort.cc:367
static void copy_native_longlong(uchar *to, size_t to_length, longlong val, bool is_unsigned)
Definition: filesort.h:123
void change_double_for_sort(double nr, uchar *to)
Definition: filesort.cc:2391
uint sortlength(THD *thd, st_sort_field *sortorder, uint s_length)
Declared here so we can unit test it.
Definition: filesort.cc:2096
This file includes constants used by all storage engines.
my_off_t ha_rows
Definition: my_base.h:1140
Some integer typedefs for easier portability.
unsigned char uchar
Definition: my_inttypes.h:52
long long int longlong
Definition: my_inttypes.h:55
uint64_t table_map
Definition: my_table_map.h:30
constexpr value_type found_rows
Definition: classic_protocol_constants.h:39
constexpr value_type is_unsigned
Definition: classic_protocol_constants.h:273
R::iterator remove_duplicates(R *rp, LESSF &&lessf=LESSF(), EQUALF &&equalf=EQUALF())
Definition: tablespace_impl.cc:392
Addon_fields_status
Definition: sort_param.h:49
Struct that holds information about a sort field.
Definition: sort_param.h:86
unsigned int uint
Definition: uca9-dump.cc:75