tags:

views:

366

answers:

2

Hi, does anyone knows why I get an overhead of 131.0 MiB on a newly created table (zero rows)? im using phpmy admin and the code of my script is

CREATE  TABLE IF NOT EXISTS `mydb`.`mytable` (
  `idRol` INT NOT NULL AUTO_INCREMENT ,
  `Rol` VARCHAR(45) NOT NULL ,
  PRIMARY KEY (`idRol`) )
ENGINE = InnoDB;

thanks in advance.

A: 

It might be because mysql generated an index on 'idRol'

Storing an index takes some space, but I am not sure if this is the reason. It's only a guess. I'm not a DBA.

Martin
He said the table has 0 rows.
Darryl Hein
+3  A: 

InnoDB uses a shared table space. That means that per default all the tables regardless of database are stored in a single file in the filesystem. This differs from for example MyISAM which stores every table as a single file.

The behaviour of InnoDB can be changed, although I don't think it's really necessary in this case. See Using Per-Table Tablespaces.

The overhead is probably the space left by deleted rows, and InnoDB will reuse it when you insert new data. It's nothing to be concerned about.

Emil H
thanks all for the quick response, but should I be concerned for the high overhead in this case? I'm seeing that in all my tables I created happens the same, thanks
Alan C