[MDEV-4359] Unable to create a DOUBLE_PREC_HB histogram? Created: 2013-04-03  Updated: 2013-04-06  Resolved: 2013-04-06

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Sergei Petrunia Assignee: Igor Babaev
Resolution: Fixed Votes: 0
Labels: mwl#253

Issue Links:
Relates
relates to MDEV-4145 Take into account the selectivity of ... Closed

 Description   

I am unable to create a double-precision histogram. I know this is weird - it
was mentioned at the optimizer call that double-precision histograms help,
which implies that somebody succeeded in creating them, but I am unable to.

I start the server and client like this, to have a clean environment

./mysql-test-run --start-and-exit
mysql -uroot -A --socket=/data0/psergey/dev2/maria-10.0-mwl253/mysql-test/var/tmp/mysqld.1.sock

Then I run:

MariaDB [(none)]> set histogram_size=10;
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [(none)]> set histogram_type='double_prec_hb';
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [(none)]> show variables like 'histogram%';
+----------------+----------------+
| Variable_name  | Value          |
+----------------+----------------+
| histogram_size | 10             |
| histogram_type | DOUBLE_PREC_HB |
+----------------+----------------+
2 rows in set (0.00 sec)
 
MariaDB [(none)]> use test;
Database changed
MariaDB [test]> create table t21 ( a int);
Query OK, 0 rows affected (0.01 sec)
 
MariaDB [test]> insert into t21 values (1),(2),(3),(4),(5);
Query OK, 5 rows affected (0.01 sec)
Records: 5  Duplicates: 0  Warnings: 0
 
MariaDB [test]> analyze table t21 persistent for all;
+----------+---------+----------+----------+
| Table    | Op      | Msg_type | Msg_text |
+----------+---------+----------+----------+
| test.t21 | analyze | status   | OK       |
+----------+---------+----------+----------+
1 row in set (0.00 sec)
 
MariaDB [test]> select *, hex(histogram),length(histogram) from mysql.column_stats where db_name='test' and table_name='t21'\G
*************************** 1. row ***************************
          db_name: test
       table_name: t21
      column_name: a
        min_value: 1
        max_value: 5
      nulls_ratio: 0.0000
       avg_length: 4.0000
    avg_frequency: 1.0000
        hist_size: 10
        hist_type: SINGLE_PREC_HB
        histogram:   �?�����
   hex(histogram): 0000FF3FFF7FFFBFFFFF
length(histogram): 10
1 row in set (0.00 sec)

So, I've got a single-precision histogram. Note that hist_type column is set,
unlike in MDEV-4357.



 Comments   
Comment by Igor Babaev [ 2013-04-06 ]

A fix for the bug has been pushed into maria-10.0-mwl253.

Generated at Thu Feb 08 06:55:49 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.