Domanda

I am using JBoss-4.2.2.GA with JBM 1.4 and I am seeing the jbm_tx table in the jmsdb schema on MySQL growing. When I select from the table I can see that there is never more that 5 rows at a time in it.

Why would the table grow to a size, on disk, of over 6GB? When it did this, my application and database suffered extramly long query times.

Is there any way to prevent the .idb file from getting so large?

È stato utile?

Soluzione

Table files will grow when the data grows, but they may also grow when the changes (insert/update/delete) create gaps between the real contents. Run this command to tell the cases apart:

mysql> select TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, ENGINE, TABLE_ROWS, DATA_LENGTH, INDEX_LENGTH, DATA_FREE from information_schema.tables ;

(Append "where table_schema = '.....'" to restrict the output to a certain database.)

If you see big values of DATA_FREE, you have gaps. Use "OPTIMIZE TABLE" to get rid of them, see the MySQL documentation for details.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top