|
SELECT * FROM information_schema.innodb_sys_tablespaces where name="test/t1";
|
SPACE NAME FLAG ROW_FORMAT PAGE_SIZE ZIP_PAGE_SIZE SPACE_TYPE FS_BLOCK_SIZE FILE_SIZE ALLOCATED_SIZE
|
5 test/t1 33 Dynamic 16384 16384 Single 4096 65536 65536
|
|
ALTER TABLE test.t1 DISCARD TABLESPACE;
|
|
SELECT * FROM information_schema.innodb_sys_tablespaces where file_size = 0;
|
SPACE NAME FLAG ROW_FORMAT PAGE_SIZE ZIP_PAGE_SIZE SPACE_TYPE FS_BLOCK_SIZE FILE_SIZE ALLOCATED_SIZE
|
5 test/t1 33 Dynamic 16384 16384 Single 0 0 0
|
By using file_size, I think we can find out whether the table is in discarded state. But the above query works only till 10.5. In 10.6, i_s view was changed
to reflect the main memory structure. Prior to that, InnoDB was traversing the innodb dictionary table to create view.
|