Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/03/2014, 01:44
elhidenoculto
 
Fecha de Ingreso: marzo-2014
Mensajes: 1
Antigüedad: 10 años, 1 mes
Puntos: 0
Tabla con millones de registros

Hola,

he creado la siguiente tabla:

Código MySQL:
Ver original
  1. CREATE TABLE  `bd_tabla`.`tabla1` (
  2.   `campo1` varchar(15) CHARACTER SET latin1 NOT NULL DEFAULT '0.000000',
  3.   `campo2` varchar(15) CHARACTER SET latin1 NOT NULL DEFAULT '0.000000',
  4.   `campo3` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  5.   `campo4` smallint(5) unsigned NOT NULL DEFAULT '0',
  6.   `campo5` double NOT NULL DEFAULT '0',
  7.   `campo6` smallint(5) unsigned NOT NULL DEFAULT '0',
  8.   `campo7` tinyint(3) unsigned NOT NULL DEFAULT '0',
  9.   `campo8` smallint(5) unsigned NOT NULL DEFAULT '999',
  10.   `campo9` tinyint(3) unsigned NOT NULL DEFAULT '0',
  11.   `campo10` varchar(255) CHARACTER SET latin1 NOT NULL,
  12.   `campo11` double NOT NULL DEFAULT '0',
  13.   `campo12` double NOT NULL DEFAULT '0',
  14.   `campo13` double NOT NULL DEFAULT '0',
  15.   `campo14` smallint(5) unsigned NOT NULL DEFAULT '0',
  16.   `fecha_insert` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  17.   `campo15` smallint(5) unsigned NOT NULL DEFAULT '0',
  18.   `campo16` smallint(5) unsigned NOT NULL DEFAULT '0',
  19.   `campo17` bigint(20) unsigned NOT NULL DEFAULT '0',
  20.   `campo18` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  21.   PRIMARY KEY (`id`),
  22.   KEY `ix_campo3` (`campo3`),
  23.   KEY `ix_campo6` (`campo6`),
  24.   KEY `fk_campo8` (`id_tipo_posicion`),
  25.   CONSTRAINT `fk_campo8` FOREIGN KEY (`campo8`) REFERENCES `bd_tabla`.`tabla2` (`campo1`) ON DELETE CASCADE ON UPDATE CASCADE
  26. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_spanish2_ci ROW_FORMAT=DYNAMIC;


Esta tabla puedes llegar a tener 1.440.000 de registros (haciendo una regla de 3) al día. Esta información tiene que estar unos 6 meses.

He pensado en generar una tabla por mes eso implicaría tener 43.200.000 registros en cada tabla. Creo que son cantidades de información muy elevadas, para acceder y moverme en ellas.

Hay un página web que hace SELECTss en esta tabla. Por otro lado, hay procesos que hacen INSERTss y UPDATEss.

El resto de la base de datos son tablas con pocos registros (no passan de 100.000 registros). La mayoría de tablas están indexadas y con claves foranas.

1.- Me pueden aconsejar un poco de como debería de administrar la tabla (pues el lema de divide y vencerás funcionaría)?
2.- Es aconsejable innodb? o mejor sería usar myisam (no creo que necesite la integridad ni hacer transacciones)


Gracias.

Última edición por gnzsoloyo; 07/03/2014 a las 03:22