← Back to team overview

maria-developers team mailing list archive

Re: Request for Discussion: Structure for JSON histogram objects


Hi, Sergey!

One point here, that we've learned the hard way on privilege tables,
store the current server version too. So that when (not if!) you'll
change the structure in the future, you won't need to resort to various
heuristics when interpreting a row.

On Jun 04, Sergey Petrunia wrote:
> Just to clarify: we are looking at two options currently.
> Please find their description below.
> == Current mysql.column_stats ==
> Currently, MariaDB defines mysql.column_stats as:
> CREATE TABLE column_stats (
>   db_name       varchar(64) COLLATE utf8mb3_bin NOT NULL,
>   table_name    varchar(64) COLLATE utf8mb3_bin NOT NULL,
>   column_name   varchar(64) COLLATE utf8mb3_bin NOT NULL,
>   min_value     varbinary(255) DEFAULT NULL,
>   max_value     varbinary(255) DEFAULT NULL,
>   nulls_ratio   decimal(12,4) DEFAULT NULL,
>   avg_length    decimal(12,4) DEFAULT NULL,
>   avg_frequency decimal(12,4) DEFAULT NULL,
>   hist_size     tinyint(3) unsigned DEFAULT NULL,
>   hist_type     enum('SINGLE_PREC_HB','DOUBLE_PREC_HB') 
>                 COLLATE utf8mb3_bin DEFAULT NULL,
>   histogram     varbinary(255) DEFAULT NULL,
>   PRIMARY KEY (db_name,table_name,column_name)
> );

VP of MariaDB Server Engineering
and security@xxxxxxxxxxx