← Back to team overview

maria-developers team mailing list archive

(no subject)

 

Hello Igor,

I was reviewing histogram code. Not much feedback so far, but I thought I would
let you know:

== Code questions ==

Is middle_point_pos() a good functio nname? It was not apparent to me what 
it meant.  For me, "middle point" is a point in the middle of a range, 
that is, a point equidistant from both ends.  
Maybe, "position_in_range" will be better?

== Histogram storage questions ==

* What does hist_size column mean? I suppose, it is number of columns in the
  histogram?

* Do we want to support only one kind of histogram? If not, maybe we should
  provision space for histogram type?

* The histogram column is VARBINARY(255). Why set a hard limit of 255 bytes?
  Maybe, use a BLOB from the start?

== A possible bug ==
I have a column with lots of NULLs:

MariaDB [test]> select nulls_ratio from mysql.column_stats where table_name='one_k' 
and column_name='tnulls';
+-------------+
| nulls_ratio |
+-------------+
|      0.9000 |
+-------------+
1 row in set (0.00 sec)

The following query crashes in maria-10.0-mwl253 tree. AFAIU, Timour has fixed
the crash in 10.0-mdev83 tree. With that tree, I get:

MariaDB [test]> explain extended select * from one_k where tnulls is not null;
+------+-------------+-------+------+---------------+------+---------+------+------+----------+-------------+
| id   | select_type | table | type | possible_keys | key  | key_len | ref  | rows | filtered | Extra       |
+------+-------------+-------+------+---------------+------+---------+------+------+----------+-------------+
|    1 | SIMPLE      | one_k | ALL  | NULL          | NULL | NULL    | NULL | 969 |   100.00 | Using where |
+------+-------------+-------+------+---------------+------+---------+------+------+----------+-------------+
1 row in set, 1 warning (0.00 sec)

Note that filtered=100%. It should be 10%.

On Mon, Mar 25, 2013 at 11:48:30PM -0700, Igor Babaev wrote:
> At file:///home/igor/maria/maria-10.0-mwl253/
> 
> ------------------------------------------------------------
> revno: 3502
> revision-id: igor@xxxxxxxxxxxx-20130326064829-3x0g8p1g7nbptusd
> parent: igor@xxxxxxxxxxxx-20130311144424-cwqe1m70in3bora0
> committer: Igor Babaev <igor@xxxxxxxxxxxx>
> branch nick: maria-10.0-mwl253
> timestamp: Mon 2013-03-25 23:48:29 -0700
> message:
>   Added histogams for table columns.


BR
 Sergei
-- 
Sergei Petrunia, Software Developer
Monty Program AB, http://askmonty.org
Blog: http://s.petrunia.net/blog