PBXT not reporting data size correctly in information_schema

Bug #368692 reported by m00dawg
2
Affects Status Importance Assigned to Milestone
PBXT
Fix Committed
Low
Vladimir Kolesnikov

Bug Description

Running a query against the information_schema on a PBXT table seems to produce a result that does not seem to be quite accurate:

mysql> SHOW CREATE TABLE Logger\G
*************************** 1. row ***************************
       Table: Logger
Create Table: CREATE TABLE `Logger` (
  `timestampOccurred` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `dateOccurred` date NOT NULL,
  `session` char(32) DEFAULT NULL,
  `host` varchar(255) DEFAULT NULL,
  `sslMode` enum('enabled','disabled') DEFAULT 'enabled',
  `requestURI` varchar(255) DEFAULT NULL,
  `referer` varchar(255) DEFAULT NULL,
  `userAgent` varchar(255) DEFAULT NULL,
  `remoteHost` int(10) unsigned NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8
1 row in set (0.00 sec)

mysql> ALTER TABLE Logger ENGINE='PBXT';
Query OK, 945463 rows affected (1 min 21.74 sec)
Records: 945463 Duplicates: 0 Warnings: 0

mysql> SELECT DATA_LENGTH / 1024 / 1024 AS Data, INDEX_LENGTH / 1024 / 1024 AS Indexes FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='Logger';
+------------+------------+
| Data | Indexes |
+------------+------------+
| 0.90166473 | 0.00390625 |
+------------+------------+
1 row in set (0.00 sec)

office101-221:test root# ls -lh
total 1195560
-rw-rw---- 1 _mysql staff 3.8M Apr 28 11:13 Logger-1.xtr
-rw-rw---- 1 _mysql staff 8.7K Apr 28 11:12 Logger.frm
-rw-rw---- 1 _mysql staff 580M Apr 28 11:13 Logger.xtd
-rw-rw---- 1 _mysql staff 4.0K Apr 28 11:12 Logger.xti
-rw-rw---- 1 _mysql staff 65B Apr 28 11:01 db.opt

mysql> ALTER TABLE Logger ENGINE='MyISAM';
Query OK, 945463 rows affected (8.29 sec)
Records: 945463 Duplicates: 0 Warnings: 0

mysql> SELECT DATA_LENGTH / 1024 / 1024 AS Data, INDEX_LENGTH / 1024 / 1024 AS Indexes FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='Logger';
+--------------+------------+
| Data | Indexes |
+--------------+------------+
| 186.35408020 | 0.00097656 |
+--------------+------------+
1 row in set (0.01 sec)

office101-221:test root# ls -lh
total 381696
-rw-rw---- 1 _mysql staff 186M Apr 28 11:14 Logger.MYD
-rw-rw---- 1 _mysql staff 1.0K Apr 28 11:14 Logger.MYI
-rw-rw---- 1 _mysql staff 8.7K Apr 28 11:14 Logger.frm
-rw-rw---- 1 _mysql staff 65B Apr 28 11:01 db.opt

.90 MB seems hard to believe, given that this table as an ARCHIVE table is around 27MB:

mysql> ALTER TABLE Logger ENGINE='Archive';
Query OK, 945463 rows affected (13.85 sec)
Records: 945463 Duplicates: 0 Warnings: 0

mysql> SELECT DATA_LENGTH / 1024 / 1024 AS Data, INDEX_LENGTH / 1024 / 1024 AS Indexes FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='Logger';
+-------------+------------+
| Data | Indexes |
+-------------+------------+
| 27.35079288 | 0.00000000 |
+-------------+------------+
1 row in set (0.00 sec)

office101-221:test root# ls -lh
total 56048
-rw-rw---- 1 _mysql staff 27M Apr 28 11:08 Logger.ARZ
-rw-rw---- 1 _mysql staff 8.7K Apr 28 11:07 Logger.frm
-rw-rw---- 1 _mysql staff 65B Apr 28 11:01 db.opt

Related branches

Revision history for this message
m00dawg (tim-moocowproductions) wrote :

My apologies! These tests were run on MySQL 5.1.34 with latest PBXT from Bazaar (revision 614). Both MySQL and PBXT were built from source on my Mac running OS X 10.5.6.

Also, though not directly related to each other perhaps, I ran the same tests for bug 368693 as well as 368692.

Changed in pbxt:
importance: Undecided → Low
Changed in pbxt:
assignee: nobody → Vladimir Kolesnikov (vkolesnikov)
status: New → In Progress
Changed in pbxt:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.