Sorting related info.
More...
#include <filesort.h>
◆ Filesort()
Filesort::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 |
|
) |
| |
◆ clear_addon_fields()
void Filesort::clear_addon_fields |
( |
| ) |
|
Reset the decision made in using_addon_fields().
Only used in exceptional circumstances (see NewWeedoutAccessPathForTables()).
◆ get_addon_fields()
Get descriptors of fields appended to sorted fields and calculate their total length.
The function first finds out what fields are used in the result set. Then it calculates the length of the buffer to store the values of these fields together with the value of sort values. If there are no large blobs (which prevent addon fields), the function allocates memory for an array of descriptors containing layouts for the values of the non-sorted fields in the buffer and fills them.
- Parameters
-
[out] | addon_fields_status | Reason for not using packed addon fields |
[out] | plength | Total length of appended fields |
[out] | ppackable_length | Total length of appended fields having a packable type |
- Note
- The null bits for the appended values are supposed to be put together and stored into the buffer just ahead of the value of the first field.
- Returns
- Pointer to the layout descriptors for the appended fields, if any
-
NULL if we do not store field values with sort data.
◆ make_sortorder()
uint Filesort::make_sortorder |
( |
ORDER * |
order, |
|
|
bool |
unwrap_rollup |
|
) |
| |
|
private |
◆ sort_order_length()
uint Filesort::sort_order_length |
( |
| ) |
const |
|
inline |
◆ using_addon_fields()
bool Filesort::using_addon_fields |
( |
| ) |
|
Whether we are using addon fields (sort entire rows) or not (sort row IDs).
Note that on the first call, this actually makes Sort_param compute the decision and cache it, so it cannot be called before the sort order is properly set up.
◆ keep_buffers
const bool Filesort::keep_buffers |
If true, do not free the filesort buffers (use if you expect to sort many times, like in an uncacheable subquery).
◆ limit
Maximum number of rows to return.
◆ m_force_sort_rowids
bool Filesort::m_force_sort_rowids |
◆ m_remove_duplicates
bool Filesort::m_remove_duplicates |
◆ m_sort_order_length
uint Filesort::m_sort_order_length |
|
private |
◆ m_sort_param
◆ m_thd
◆ sortorder
ORDER BY list with some precalculated info for filesort.
◆ tables
The tables we are sorting.
◆ using_pq
true means we are using Priority Queue for order by with limit.
The documentation for this class was generated from the following files: