Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/MariaDB/mysql-test/suite/innodb/t/   (MariaDB Server Version 8.1-8.4©)  Datei vom 1.9.2026 mit Größe 1 kB image not shown  

Quelle  table_index_statistics.inc   Sprache: Delphi

 

# include file to test index and table statstics for specific storage engine
# requires includer set the default storage engine for the session

# Bug 602047 (wrong rows_read value)

FLUSH INDEX_STATISTICS;
FLUSH TABLE_STATISTICS;

SET @userstat_old= @@userstat;
SET GLOBAL userstat=ON;

--disable_ps2_protocol
CREATE TABLE t1 (id int(10), PRIMARY KEY (id));
INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
FLUSH TABLE_STATISTICS;
SELECT SUM(id) FROM t1;
SELECT ROWS_READ FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t1';
SELECT ROWS_READ FROM INFORMATION_SCHEMA.INDEX_STATISTICS WHERE TABLE_NAME='t1';

SELECT PAGES_ACCESSED, PAGES_READ_FROM_DISK FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t1';

# Test that FLUSH clears one table but not another

FLUSH TABLE_STATISTICS;

SELECT ROWS_READ FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t1';
SELECT ROWS_READ FROM INFORMATION_SCHEMA.INDEX_STATISTICS WHERE TABLE_NAME='t1';

# Test that FLUSH clears both tables now

FLUSH INDEX_STATISTICS;

SELECT ROWS_READ FROM INFORMATION_SCHEMA.INDEX_STATISTICS WHERE TABLE_NAME='t1';

# Test that stats are collected after the FLUSH again

SELECT COUNT(*) FROM t1; 
SELECT ROWS_READ FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t1';
SELECT ROWS_READ FROM INFORMATION_SCHEMA.INDEX_STATISTICS WHERE TABLE_NAME='t1';
--enable_ps2_protocol

DROP TABLE t1;

# Bug 1183625 (handler::update_global_table_stats crash).

CREATE TABLE t2 (c1 INT UNSIGNED);

ALTER TABLE t2 MODIFY c1 FLOAT;

SELECT * FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t2';

DROP TABLE t2;

# Bug 1183625 (handler::update_global_table_stats crash).

CREATE TABLE t2 (c1 INT UNSIGNED);

ALTER TABLE t2 MODIFY c1 FLOAT;

SELECT * FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t2';

DROP TABLE t2;

SET GLOBAL userstat= @userstat_old;

Messung V0.5 in Prozent
C=100 H=60 G=82

¤ Dauer der Verarbeitung: 0.13 Sekunden  (vorverarbeitet am  2026-10-08) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.