MySQL 8.0.40
Source Code Documentation
Filesort_info Class Reference

A class wrapping misc buffers used for sorting. More...

#include <sql_sort.h>

Public Member Functions

 Filesort_info (const Filesort_info &)=delete
 
Filesort_infooperator= (const Filesort_info &)=delete
 
 Filesort_info ()
 
size_t sort_buffer (Sort_param *param, size_t num_input_rows, size_t max_output_rows)
 Sort filesort_buffer. More...
 
template<bool Packed_addon_fields>
void unpack_addon_fields (const Mem_root_array< TABLE * > &tables, uchar *buff)
 Copies (unpacks) values appended to sorted fields from a buffer back to their regular positions specified by the Field::ptr pointers. More...
 
void read_chunk_descriptors (IO_CACHE *chunk_file, uint count)
 Reads 'count' number of chunk descriptors into the merge_chunks array. More...
 
bool using_addon_fields () const
 Are we using "addon fields"? More...
 
void reset ()
 
void clear_peak_memory_used ()
 
Bounds_checked_array< ucharget_next_record_pointer (size_t min_size)
 
void commit_used_memory (size_t num_bytes)
 
ucharget_sorted_record (uint idx)
 
uchar ** get_sort_keys ()
 
Bounds_checked_array< ucharget_contiguous_buffer ()
 
void set_max_size (size_t max_size, size_t record_length)
 
void free_sort_buffer ()
 
bool preallocate_records (size_t num_records)
 
size_t peak_memory_used () const
 
size_t max_size_in_bytes () const
 
uint sort_length () const
 
bool using_varlen_keys () const
 
void set_sort_length (uint val, bool is_varlen)
 

Public Attributes

Merge_chunk_array merge_chunks
 Array of chunk descriptors. More...
 
Addon_fieldsaddon_fields {nullptr}
 Addon field descriptors. More...
 
bool m_using_varlen_keys {false}
 
uint m_sort_length {0}
 

Private Attributes

Filesort_buffer filesort_buffer
 Buffer for sorting keys. More...
 

Detailed Description

A class wrapping misc buffers used for sorting.

Constructor & Destructor Documentation

◆ Filesort_info() [1/2]

Filesort_info::Filesort_info ( const Filesort_info )
delete

◆ Filesort_info() [2/2]

Filesort_info::Filesort_info ( )
inline

Member Function Documentation

◆ clear_peak_memory_used()

void Filesort_info::clear_peak_memory_used ( )
inline

◆ commit_used_memory()

void Filesort_info::commit_used_memory ( size_t  num_bytes)
inline

◆ free_sort_buffer()

void Filesort_info::free_sort_buffer ( )
inline

◆ get_contiguous_buffer()

Bounds_checked_array< uchar > Filesort_info::get_contiguous_buffer ( )
inline

◆ get_next_record_pointer()

Bounds_checked_array< uchar > Filesort_info::get_next_record_pointer ( size_t  min_size)
inline

◆ get_sort_keys()

uchar ** Filesort_info::get_sort_keys ( )
inline

◆ get_sorted_record()

uchar * Filesort_info::get_sorted_record ( uint  idx)
inline

◆ max_size_in_bytes()

size_t Filesort_info::max_size_in_bytes ( ) const
inline

◆ operator=()

Filesort_info & Filesort_info::operator= ( const Filesort_info )
delete

◆ peak_memory_used()

size_t Filesort_info::peak_memory_used ( ) const
inline

◆ preallocate_records()

bool Filesort_info::preallocate_records ( size_t  num_records)
inline

◆ read_chunk_descriptors()

void Filesort_info::read_chunk_descriptors ( IO_CACHE chunk_file,
uint  count 
)

Reads 'count' number of chunk descriptors into the merge_chunks array.

In case of error, the merge_chunks array will be empty.

Parameters
chunk_fileFile containing the descriptors.
countNumber of chunks to read.

◆ reset()

void Filesort_info::reset ( void  )
inline

◆ set_max_size()

void Filesort_info::set_max_size ( size_t  max_size,
size_t  record_length 
)
inline

◆ set_sort_length()

void Filesort_info::set_sort_length ( uint  val,
bool  is_varlen 
)
inline

◆ sort_buffer()

size_t Filesort_info::sort_buffer ( Sort_param param,
size_t  num_input_rows,
size_t  max_output_rows 
)
inline

Sort filesort_buffer.

Returns
Number of records, after any deduplication

◆ sort_length()

uint Filesort_info::sort_length ( ) const
inline

◆ unpack_addon_fields()

template<bool Packed_addon_fields>
void Filesort_info::unpack_addon_fields ( const Mem_root_array< TABLE * > &  tables,
uchar buff 
)
inline

Copies (unpacks) values appended to sorted fields from a buffer back to their regular positions specified by the Field::ptr pointers.

Parameters
tablesTables in the join; for NULL row flags.
buffBuffer which to unpack the value from.

◆ using_addon_fields()

bool Filesort_info::using_addon_fields ( ) const
inline

Are we using "addon fields"?

◆ using_varlen_keys()

bool Filesort_info::using_varlen_keys ( ) const
inline

Member Data Documentation

◆ addon_fields

Addon_fields* Filesort_info::addon_fields {nullptr}

Addon field descriptors.

◆ filesort_buffer

Filesort_buffer Filesort_info::filesort_buffer
private

Buffer for sorting keys.

◆ m_sort_length

uint Filesort_info::m_sort_length {0}

◆ m_using_varlen_keys

bool Filesort_info::m_using_varlen_keys {false}

◆ merge_chunks

Merge_chunk_array Filesort_info::merge_chunks

Array of chunk descriptors.


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