MDEV-6430: It is impossible to see if "filesort with small limit" optimization was used
- Make log_slow_verbosity print "Priority_queue: (Yes|No)" into the slow query log. (but we do not add a correspoding column to P_S.*statement* tables).
This commit is contained in:
parent
653bf17716
commit
16779f6069
@ -225,6 +225,7 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
|
||||
table, num_rows, memory_available))
|
||||
{
|
||||
DBUG_PRINT("info", ("filesort PQ is applicable"));
|
||||
thd->query_plan_flags|= QPLAN_FILESORT_PRIORITY_QUEUE;
|
||||
const size_t compare_length= param.sort_length;
|
||||
if (pq.init(param.max_rows,
|
||||
true, // max_at_top
|
||||
|
@ -2904,7 +2904,8 @@ bool MYSQL_QUERY_LOG::write(THD *thd, time_t current_time,
|
||||
my_b_printf(&log_file,
|
||||
"# Full_scan: %s Full_join: %s "
|
||||
"Tmp_table: %s Tmp_table_on_disk: %s\n"
|
||||
"# Filesort: %s Filesort_on_disk: %s Merge_passes: %lu\n",
|
||||
"# Filesort: %s Filesort_on_disk: %s Merge_passes: %lu "
|
||||
"Priority_queue: %s\n",
|
||||
((thd->query_plan_flags & QPLAN_FULL_SCAN) ? "Yes" : "No"),
|
||||
((thd->query_plan_flags & QPLAN_FULL_JOIN) ? "Yes" : "No"),
|
||||
((thd->query_plan_flags & QPLAN_TMP_TABLE) ? "Yes" : "No"),
|
||||
@ -2912,7 +2913,10 @@ bool MYSQL_QUERY_LOG::write(THD *thd, time_t current_time,
|
||||
((thd->query_plan_flags & QPLAN_FILESORT) ? "Yes" : "No"),
|
||||
((thd->query_plan_flags & QPLAN_FILESORT_DISK) ?
|
||||
"Yes" : "No"),
|
||||
thd->query_plan_fsort_passes) == (size_t) -1)
|
||||
thd->query_plan_fsort_passes,
|
||||
((thd->query_plan_flags & QPLAN_FILESORT_PRIORITY_QUEUE) ?
|
||||
"Yes" : "No")
|
||||
) == (size_t) -1)
|
||||
tmp_errno= errno;
|
||||
if (thd->variables.log_slow_verbosity & LOG_SLOW_VERBOSITY_EXPLAIN &&
|
||||
thd->lex->explain)
|
||||
|
@ -31,6 +31,8 @@
|
||||
#define QPLAN_QC_NO 1 << 6
|
||||
#define QPLAN_TMP_DISK 1 << 7
|
||||
#define QPLAN_TMP_TABLE 1 << 8
|
||||
#define QPLAN_FILESORT_PRIORITY_QUEUE 1 << 9
|
||||
|
||||
/* ... */
|
||||
#define QPLAN_MAX ((ulong) 1) << 31 /* reserved as placeholder */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user