1
0
mirror of https://github.com/MariaDB/server.git synced 2026-10-23 18:49:29 +03:00

Remove JOIN::need_distinct

The member was assigned in JOIN::init(), JOIN::optimize_inner() and
JOIN::optimize_stage2(), but never read. Its last reads, the arguments
of prepare_sum_aggregators() calls, were removed by:
commit 2cfc450bf7
Author: Igor Babaev <igor@askmonty.org>
Date:   Tue Feb 9 2016

    This is the consolidated patch for mdev-8646: "Re-factor the code
    for post-join operations".

Since then the callers compute the value themselves from
is_using_agg_loose_index_scan().

JOIN::prepare_sum_aggregators() has a parameter of the same name, which
is unrelated and is kept.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Sergei Petrunia
2026-10-23 18:14:03 +03:00
parent 291c71dc8a
commit b0cb207dfe
2 changed files with 0 additions and 4 deletions

View File

@@ -530,7 +530,6 @@ void JOIN::init(THD *thd_arg, List<Item> &fields_arg,
simple_order= 0;
simple_group= 0;
ordered_index_usage= ordered_index_void;
need_distinct= 0;
skip_sort_order= 0;
with_two_phase_optimization= 0;
save_qep= 0;
@@ -2247,7 +2246,6 @@ JOIN::optimize_inner()
do_send_rows = (unit->lim.get_select_limit()) ? 1 : 0;
set_allowed_join_cache_types();
need_distinct= TRUE;
Json_writer_object trace_wrapper(thd);
Json_writer_object trace_prepare(thd, "join_optimization");
@@ -3589,7 +3587,6 @@ int JOIN::optimize_stage2()
tmp_table_param.precomputed_group_by= TRUE;
if (join_tab->is_using_agg_loose_index_scan())
{
need_distinct= FALSE;
tmp_table_param.precomputed_group_by= FALSE;
}
}

View File

@@ -1609,7 +1609,6 @@ public:
group_list)
*/
bool group;
bool need_distinct;
/**
Indicates that grouping will be performed on the result set during