1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

feat(rbo,rules): mock Histogram for ES < 11.4

This commit is contained in:
drrtuy
2025-07-18 15:55:22 +00:00
parent e600f11aa9
commit a01c883e07
2 changed files with 37 additions and 0 deletions

View File

@ -6291,6 +6291,8 @@ int processLimitAndOffset(SELECT_LEX& select_lex, gp_walk_info& gwi, SCSEP& csep
// Loop over available indexes to find and extract corresponding EI column statistics
// for the first column of the index if any.
// Statistics is stored in GWI context.
// Mock for ES 10.6
#if MYSQL_VERSION_ID >= 110401
void extractColumnStatistics(Item_field* ifp, gp_walk_info& gwi)
{
for (uint j = 0; j < ifp->field->table->s->keys; j++)
@ -6313,6 +6315,11 @@ void extractColumnStatistics(Item_field* ifp, gp_walk_info& gwi)
}
}
}
#else
void extractColumnStatistics(Item_field* ifp, gp_walk_info& gwi)
{
}
#endif
/*@brief Process SELECT part of a query or sub-query */
/***********************************************************

View File

@ -74,7 +74,37 @@
#include "rpl_rli.h"
#include "my_dbug.h"
#include "sql_show.h"
#if MYSQL_VERSION_ID >= 110401
#include "opt_histogram_json.h"
#else
// Mock Histogram_bucket for MySQL < 11.4
struct Histogram_bucket
{
std::string start_value;
double cum_fract;
longlong ndv;
};
class Histogram_json_hb final : public Histogram_base
{
std::vector<Histogram_bucket> buckets;
std::string last_bucket_end_endp;
public:
const std::vector<Histogram_bucket>& get_json_histogram() const
{
return buckets;
}
const std::string& get_last_bucket_end_endp() const
{
return last_bucket_end_endp;
}
};
#endif
#pragma GCC diagnostic pop
// Now clean up the pollution as best we can...