1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-26519: Improved histograms: Make JSON parser efficient

Previous JSON parser was using an API which made the parsing
inefficient: the same JSON contents was parsed again and again.

Switch to using a lower-level parsing API which allows to do
parsing in an efficient way.
This commit is contained in:
Sergei Petrunia
2021-12-02 11:54:10 +03:00
parent be55ad0d34
commit 1d14176ec4
7 changed files with 358 additions and 188 deletions

View File

@ -154,7 +154,9 @@ class Histogram_builder;
class Histogram_base
{
public:
virtual bool parse(MEM_ROOT *mem_root, Field *field, Histogram_type type_arg,
virtual bool parse(MEM_ROOT *mem_root,
const char *db_name, const char *table_name,
Field *field, Histogram_type type_arg,
const char *hist_data, size_t hist_data_len)= 0;
virtual void serialize(Field *to_field)= 0;
@ -311,8 +313,9 @@ public:
Histogram_type get_type() override { return type; }
bool parse(MEM_ROOT *mem_root, Field *, Histogram_type type_arg,
const char *hist_data, size_t hist_data_len) override;
bool parse(MEM_ROOT *mem_root, const char*, const char*, Field*,
Histogram_type type_arg, const char *hist_data,
size_t hist_data_len) override;
void serialize(Field *to_field) override;
void init_for_collection(MEM_ROOT *mem_root, Histogram_type htype_arg,
ulonglong size) override;