Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL)
-
None
Description
A mtr test
--source include/have_archive.inc
|
CREATE TABLE gis_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT)engine=archive; |
INSERT INTO gis_point VALUES |
(101, PointFromText('POINT(10 10)')), |
(102, PointFromText('POINT(20 10)')), |
(103, PointFromText('POINT(20 20)')), |
(104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); |
set @@optimizer_use_condition_selectivity=4; |
set @@use_stat_tables=PREFERABLY; |
ANALYZE TABLE gis_point; |
explain select * from gis_point; |
+----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+
|
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
|
+----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+
|
| 1 | SIMPLE | gis_point| ALL | NULL | NULL | NULL | NULL | 0 | |
|
+----+-------------+----------+--------+---------------------------------+-------+-------+----------+
|
select * from mysql.table_stats;
|
db_name table_name cardinality
|
test gis_point 0
|
After debugging I see, when we enter the function collect_statistics_for_table , for archive engine we get HA_ERR_END_OF_FILE when we start reading the rows, as stats.records = 0
Attachments
Issue Links
- is part of
-
MDEV-15253 Default optimizer setting changes for MariaDB 10.4
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Description |
A mtr test
--source include/have_inndob.inc CREATE TABLE gis_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT)engine=archive; INSERT INTO gis_point VALUES (101, PointFromText('POINT(10 10)')), (102, PointFromText('POINT(20 10)')), (103, PointFromText('POINT(20 20)')), (104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); ANALYZE TABLE gis_point; set @@optimizer_use_condition_selectivitity=4; set @@use_stat_tables=PREFERABLY; explain select * from gis_point; +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | 1 | SIMPLE | gis_point| ALL | NULL | NULL | NULL | NULL | 0 | | +----+-------------+----------+--------+---------------------------------+-------+-------+----------+ |
Description |
A mtr test
--source include/have_inndob.inc CREATE TABLE gis_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT)engine=archive; INSERT INTO gis_point VALUES (101, PointFromText('POINT(10 10)')), (102, PointFromText('POINT(20 10)')), (103, PointFromText('POINT(20 20)')), (104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); ANALYZE TABLE gis_point; set @@optimizer_use_condition_selectivitity=4; set @@use_stat_tables=PREFERABLY; explain select * from gis_point; +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | 1 | SIMPLE | gis_point| ALL | NULL | NULL | NULL | NULL | 0 | | +----+-------------+----------+--------+---------------------------------+-------+-------+----------+ |
A mtr test
--source include/have_inndob.inc CREATE TABLE gis_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT)engine=archive; INSERT INTO gis_point VALUES (101, PointFromText('POINT(10 10)')), (102, PointFromText('POINT(20 10)')), (103, PointFromText('POINT(20 20)')), (104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); ANALYZE TABLE gis_point; set @@optimizer_use_condition_selectivitity=4; set @@use_stat_tables=PREFERABLY; explain select * from gis_point; {noformat} +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | 1 | SIMPLE | gis_point| ALL | NULL | NULL | NULL | NULL | 0 | | +----+-------------+----------+--------+---------------------------------+-------+-------+----------+ {noformat} |
Description |
A mtr test
--source include/have_inndob.inc CREATE TABLE gis_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT)engine=archive; INSERT INTO gis_point VALUES (101, PointFromText('POINT(10 10)')), (102, PointFromText('POINT(20 10)')), (103, PointFromText('POINT(20 20)')), (104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); ANALYZE TABLE gis_point; set @@optimizer_use_condition_selectivitity=4; set @@use_stat_tables=PREFERABLY; explain select * from gis_point; {noformat} +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | 1 | SIMPLE | gis_point| ALL | NULL | NULL | NULL | NULL | 0 | | +----+-------------+----------+--------+---------------------------------+-------+-------+----------+ {noformat} |
A mtr test
--source include/have_inndob.inc CREATE TABLE gis_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT)engine=archive; INSERT INTO gis_point VALUES (101, PointFromText('POINT(10 10)')), (102, PointFromText('POINT(20 10)')), (103, PointFromText('POINT(20 20)')), (104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); set @@optimizer_use_condition_selectivitity=4; set @@use_stat_tables=PREFERABLY; ANALYZE TABLE gis_point; explain select * from gis_point; {noformat} +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | 1 | SIMPLE | gis_point| ALL | NULL | NULL | NULL | NULL | 0 | | +----+-------------+----------+--------+---------------------------------+-------+-------+----------+ {noformat} |
Description |
A mtr test
--source include/have_inndob.inc CREATE TABLE gis_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT)engine=archive; INSERT INTO gis_point VALUES (101, PointFromText('POINT(10 10)')), (102, PointFromText('POINT(20 10)')), (103, PointFromText('POINT(20 20)')), (104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); set @@optimizer_use_condition_selectivitity=4; set @@use_stat_tables=PREFERABLY; ANALYZE TABLE gis_point; explain select * from gis_point; {noformat} +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | 1 | SIMPLE | gis_point| ALL | NULL | NULL | NULL | NULL | 0 | | +----+-------------+----------+--------+---------------------------------+-------+-------+----------+ {noformat} |
A mtr test
{code:sql} --source include/have_inndob.inc CREATE TABLE gis_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT)engine=archive; INSERT INTO gis_point VALUES (101, PointFromText('POINT(10 10)')), (102, PointFromText('POINT(20 10)')), (103, PointFromText('POINT(20 20)')), (104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); set @@optimizer_use_condition_selectivitity=4; set @@use_stat_tables=PREFERABLY; ANALYZE TABLE gis_point; explain select * from gis_point; {code} {noformat} +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | 1 | SIMPLE | gis_point| ALL | NULL | NULL | NULL | NULL | 0 | | +----+-------------+----------+--------+---------------------------------+-------+-------+----------+ {noformat} |
Description |
A mtr test
{code:sql} --source include/have_inndob.inc CREATE TABLE gis_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT)engine=archive; INSERT INTO gis_point VALUES (101, PointFromText('POINT(10 10)')), (102, PointFromText('POINT(20 10)')), (103, PointFromText('POINT(20 20)')), (104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); set @@optimizer_use_condition_selectivitity=4; set @@use_stat_tables=PREFERABLY; ANALYZE TABLE gis_point; explain select * from gis_point; {code} {noformat} +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | 1 | SIMPLE | gis_point| ALL | NULL | NULL | NULL | NULL | 0 | | +----+-------------+----------+--------+---------------------------------+-------+-------+----------+ {noformat} |
A mtr test
{code:sql} --source include/have_inndob.inc CREATE TABLE gis_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT)engine=archive; INSERT INTO gis_point VALUES (101, PointFromText('POINT(10 10)')), (102, PointFromText('POINT(20 10)')), (103, PointFromText('POINT(20 20)')), (104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); set @@optimizer_use_condition_selectivitity=4; set @@use_stat_tables=PREFERABLY; ANALYZE TABLE gis_point; explain select * from gis_point; {code} {noformat} +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | 1 | SIMPLE | gis_point| ALL | NULL | NULL | NULL | NULL | 0 | | +----+-------------+----------+--------+---------------------------------+-------+-------+----------+ {noformat} {noformat} select * from mysql.table_stats; db_name table_name cardinality test gis_point 0 {noformat} |
Description |
A mtr test
{code:sql} --source include/have_inndob.inc CREATE TABLE gis_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT)engine=archive; INSERT INTO gis_point VALUES (101, PointFromText('POINT(10 10)')), (102, PointFromText('POINT(20 10)')), (103, PointFromText('POINT(20 20)')), (104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); set @@optimizer_use_condition_selectivitity=4; set @@use_stat_tables=PREFERABLY; ANALYZE TABLE gis_point; explain select * from gis_point; {code} {noformat} +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | 1 | SIMPLE | gis_point| ALL | NULL | NULL | NULL | NULL | 0 | | +----+-------------+----------+--------+---------------------------------+-------+-------+----------+ {noformat} {noformat} select * from mysql.table_stats; db_name table_name cardinality test gis_point 0 {noformat} |
A mtr test
{code:sql} --source include/have_inndob.inc CREATE TABLE gis_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT)engine=archive; INSERT INTO gis_point VALUES (101, PointFromText('POINT(10 10)')), (102, PointFromText('POINT(20 10)')), (103, PointFromText('POINT(20 20)')), (104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); set @@optimizer_use_condition_selectivitity=4; set @@use_stat_tables=PREFERABLY; ANALYZE TABLE gis_point; explain select * from gis_point; {code} {noformat} +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | 1 | SIMPLE | gis_point| ALL | NULL | NULL | NULL | NULL | 0 | | +----+-------------+----------+--------+---------------------------------+-------+-------+----------+ {noformat} {noformat} select * from mysql.table_stats; db_name table_name cardinality test gis_point 0 {noformat} After debugging I see, when we enter the function collect_statistics_for_table , for archive engine we get END_OF_FILE when we start reading the rows, as stats.records = 0 |
Description |
A mtr test
{code:sql} --source include/have_inndob.inc CREATE TABLE gis_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT)engine=archive; INSERT INTO gis_point VALUES (101, PointFromText('POINT(10 10)')), (102, PointFromText('POINT(20 10)')), (103, PointFromText('POINT(20 20)')), (104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); set @@optimizer_use_condition_selectivitity=4; set @@use_stat_tables=PREFERABLY; ANALYZE TABLE gis_point; explain select * from gis_point; {code} {noformat} +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | 1 | SIMPLE | gis_point| ALL | NULL | NULL | NULL | NULL | 0 | | +----+-------------+----------+--------+---------------------------------+-------+-------+----------+ {noformat} {noformat} select * from mysql.table_stats; db_name table_name cardinality test gis_point 0 {noformat} After debugging I see, when we enter the function collect_statistics_for_table , for archive engine we get END_OF_FILE when we start reading the rows, as stats.records = 0 |
A mtr test
{code:sql} --source include/have_inndob.inc CREATE TABLE gis_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT)engine=archive; INSERT INTO gis_point VALUES (101, PointFromText('POINT(10 10)')), (102, PointFromText('POINT(20 10)')), (103, PointFromText('POINT(20 20)')), (104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); set @@optimizer_use_condition_selectivitity=4; set @@use_stat_tables=PREFERABLY; ANALYZE TABLE gis_point; explain select * from gis_point; {code} {noformat} +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | 1 | SIMPLE | gis_point| ALL | NULL | NULL | NULL | NULL | 0 | | +----+-------------+----------+--------+---------------------------------+-------+-------+----------+ {noformat} {noformat} select * from mysql.table_stats; db_name table_name cardinality test gis_point 0 {noformat} After debugging I see, when we enter the function collect_statistics_for_table , for archive engine we get HA_ERR_END_OF_FILE when we start reading the rows, as stats.records = 0 |
Fix Version/s | 10.4 [ 22408 ] |
Link |
This issue is part of |
Description |
A mtr test
{code:sql} --source include/have_inndob.inc CREATE TABLE gis_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT)engine=archive; INSERT INTO gis_point VALUES (101, PointFromText('POINT(10 10)')), (102, PointFromText('POINT(20 10)')), (103, PointFromText('POINT(20 20)')), (104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); set @@optimizer_use_condition_selectivitity=4; set @@use_stat_tables=PREFERABLY; ANALYZE TABLE gis_point; explain select * from gis_point; {code} {noformat} +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | 1 | SIMPLE | gis_point| ALL | NULL | NULL | NULL | NULL | 0 | | +----+-------------+----------+--------+---------------------------------+-------+-------+----------+ {noformat} {noformat} select * from mysql.table_stats; db_name table_name cardinality test gis_point 0 {noformat} After debugging I see, when we enter the function collect_statistics_for_table , for archive engine we get HA_ERR_END_OF_FILE when we start reading the rows, as stats.records = 0 |
A mtr test
{code:sql} --source include/have_archive.inc CREATE TABLE gis_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT)engine=archive; INSERT INTO gis_point VALUES (101, PointFromText('POINT(10 10)')), (102, PointFromText('POINT(20 10)')), (103, PointFromText('POINT(20 20)')), (104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)')))); set @@optimizer_use_condition_selectivity=4; set @@use_stat_tables=PREFERABLY; ANALYZE TABLE gis_point; explain select * from gis_point; {code} {noformat} +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+----------+--------+----------------+------+---------+-------+-------+----------+ | 1 | SIMPLE | gis_point| ALL | NULL | NULL | NULL | NULL | 0 | | +----+-------------+----------+--------+---------------------------------+-------+-------+----------+ {noformat} {noformat} select * from mysql.table_stats; db_name table_name cardinality test gis_point 0 {noformat} After debugging I see, when we enter the function collect_statistics_for_table , for archive engine we get HA_ERR_END_OF_FILE when we start reading the rows, as stats.records = 0 |
Status | Open [ 1 ] | In Progress [ 3 ] |
Fix Version/s | 10.1 [ 16100 ] | |
Fix Version/s | 10.2 [ 14601 ] | |
Fix Version/s | 10.3 [ 22126 ] |
Assignee | Varun Gupta [ varun ] | Sergei Petrunia [ psergey ] |
Assignee | Sergei Petrunia [ psergey ] | Sergei Golubchik [ serg ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Assignee | Sergei Golubchik [ serg ] | Sergei Petrunia [ psergey ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
issue.field.resolutiondate | 2019-04-18 20:16:05.0 | 2019-04-18 20:16:05.978 |
Component/s | Storage Engine - Archive [ 14003 ] | |
Fix Version/s | 10.1.39 [ 23305 ] | |
Fix Version/s | 10.2.24 [ 23308 ] | |
Fix Version/s | 10.3.15 [ 23309 ] | |
Fix Version/s | 10.4.5 [ 23311 ] | |
Fix Version/s | 10.2 [ 14601 ] | |
Fix Version/s | 10.1 [ 16100 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Workflow | MariaDB v3 [ 89770 ] | MariaDB v4 [ 154980 ] |
ha_archive::rnd_init() assumes that ha_archive::info( was called before:
{
scan_rows= stats.records;
and later in ha_archive::rnd_next()
{
rc= HA_ERR_END_OF_FILE;
}
scan_rows--;
This assumption is false. If Archive needs to know the number of rows before rnd_init, it should calculate this number in external_lock, not rely on info being invoked by the caller.