For some reason in a specific table in my database, it takes about 30 seconds to insert a single row.
The thing is that before I looked at the table and each column of text was set as textarea so I updated to see if it improved performance but nothing.
I have also done it with the copy tables, because it has an insert into before trigger that also had the same configuration problems.
However, it continues to give problems.
There is the query
INSERT IGNORE INTO bbdd_gestion_new.publicados
(sku, referencia, cantidad, estado_amazon,
estado_ebay, EAN, ASIN, titulo, tipo,
preciocompra, preciocompra_b, precioventa, precioamazon,
short_description, short_description_en, short_description_de, descripcion,
familiatienda,
familiaebay, imagen, fecha,
portes_N, portes_I1, portes_I2, revision, comentarios, ubicacion,
peso, usuario, marca)
VALUES
('6920702794790-R', 'W17-BM5047', '1', 'No publicar', '7000',
'6920702794790', 'B00K0EI562',
'Huawei E3131H - Llave Bluetooth 3G, color blanco.',
'Retourware',
'2.85', '2.85', '4.99', '0',
'PRODUCTO RETOUR-WARE – Artículo original completo procedente de devolución. Su funcionamiento no ha sido comprobado. Puede mostrar signos de desgaste y/o carecer de su embalaje original e instrucciones. No ha sido aperturado ni manipulado para el aprovechamiento de sus componentes.',
'PRODUCT RETOUR-WARE – Original item originating from return. Its operation has not been proven. It may show signs of wear and / or lack of its original packaging and instructions. It has not been opened or manipulated for the use of its components.',
'PRODUKT RETOUR-WARE – Originalartikel, der von der Rücksendung stammt. Seine Funktionsweise wurde nicht nachgewiesen. Es kann Anzeichen von Verschleiß und / oder das Fehlen der Originalverpackung und der Gebrauchsanweisung aufweisen. Es wurde für die Verwendung seiner Komponenten nicht geöffnet oder manipuliert.',
' Huawei E3131 Llave 3 G soltarse todo operadorHSPA +/HSPA/UMTS/GSM/GPRS/EDGE',
'Informatica>Categorias>Dispositivos de red>Adaptadores de red', '667049031>667050031>937958031>937959031',
'https://images-eu.ssl-images-amazon.com/images/I/31sZA-aS1fL._SL160_.jpg',
'2019-02-18 13:12:01', '3.99', '9.99', '9.99', '',
'producto subido por cron_publicar_rotos',
'', '1', 'user', 'Huawei');
There is the table in question.
CREATE TABLE IF NOT EXISTS `publicados` (
`sku` varchar(20) NOT NULL,
`referencia` varchar(20) NOT NULL,
`cantidad` int(11) NOT NULL,
`estado_amazon` varchar(64) NOT NULL,
`estado_ebay` int(11) NOT NULL,
`EAN` varchar(24) NOT NULL,
`ASIN` varchar(24) NOT NULL,
`titulo` varchar(70) NOT NULL,
`tipo` varchar(15) NOT NULL,
`preciocompra` decimal(8,2) unsigned NOT NULL,
`preciocompra_b` decimal(8,2) NOT NULL,
`precioventa` decimal(8,2) NOT NULL,
`precioamazon` decimal(8,2) NOT NULL,
`short_description` varchar(256) NOT NULL,
`short_description_en` varchar(256) DEFAULT NULL,
`short_description_de` varchar(256) DEFAULT NULL,
`descripcion` varchar(4096) NOT NULL,
`familiatienda` varchar(100) NOT NULL,
`familiaebay` varchar(100) NOT NULL,
`imagen` varchar(100) NOT NULL,
`fecha` datetime NOT NULL,
`portes_N` decimal(8,2) NOT NULL,
`portes_I1` decimal(8,2) NOT NULL,
`portes_I2` decimal(8,2) NOT NULL,
`revision` varchar(1) NOT NULL,
`comentarios` varchar(256) NOT NULL,
`ubicacion` varchar(20) DEFAULT NULL,
`peso` decimal(6,3) NOT NULL,
`usuario` varchar(20) DEFAULT NULL,
`marca` varchar(24) DEFAULT NULL,
PRIMARY KEY (`referencia`),
KEY `cantidad` (`cantidad`),
KEY `sku` (`sku`),
KEY `ubicacion` (`ubicacion`),
KEY `fecha` (`fecha`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
I am using PHP 5.3 and HeidiSQL like viewer. And there is the warnings
Warning: Data truncated for column 'short_description' at row 1
Warning: Data truncated for column 'short_description_de' at row 1
The length of your short description is 282 by my count and the column is set to 256. Increase the length of the column to allow for accomodation of the longest description. One option is to use max length: VARCHAR(21844) CHARACTER SET utf8.