I was asked to help to check a table and improve performance. The table is a large table with a 2.000.000 rows and is growing fast. There are lot's of users who are using this table with a lot of update / insert and delete queries.
Maybe you can give me some good advice to improve performance and realibity
Here is the table definition:
CREATE TABLE `calculate` ( `GROUP_LINE_ID` BIGINT(250) NOT NULL DEFAULT '0', `GROUP_LINE_PARENT_ID` BIGINT(250) NOT NULL DEFAULT '0', `MOEDER_LINE_CODE` BIGINT(250) NOT NULL DEFAULT '0', `CALC_ID` BIGINT(250) NOT NULL DEFAULT '0', `GROUP_ID` BIGINT(250) NOT NULL DEFAULT '0', `CODE` VARCHAR(250) DEFAULT NULL, `DESCRIPTION` VARCHAR(250) DEFAULT NULL, `RAW_AMOUNT` DECIMAL(50,3) NOT NULL DEFAULT '0.000', `AMOUNT` DECIMAL(50,3) NOT NULL DEFAULT '0.000', `UNIT` VARCHAR(100) DEFAULT NULL, `MEN_HOURS` DECIMAL(50,3) NOT NULL DEFAULT '0.000', `PRICE_PER_UNIT` DECIMAL(50,3) NOT NULL DEFAULT '0.000', `CONTRACTOR_UNIT` DECIMAL(50,3) NOT NULL DEFAULT '0.000', `POSTS_PER_UNIT` DECIMAL(50,3) NOT NULL DEFAULT '0.000', `SORT_INDEX` BIGINT(250) NOT NULL DEFAULT '0', `FACTOR` DECIMAL(50,4) NOT NULL DEFAULT '0.0000', `FACTOR_TYPE` INT(2) NOT NULL DEFAULT '0', `ROUND_AT` DECIMAL(50,2) NOT NULL DEFAULT '0.00', `MATERIAL_ID` BIGINT(250) NOT NULL DEFAULT '0', `MINIMUM` DECIMAL(50,2) NOT NULL DEFAULT '0.00', `LINE_TYPE` INT(1) NOT NULL DEFAULT '0', `ONDERDRUKT` INT(5) NOT NULL DEFAULT '0', `MARKED` INT(5) NOT NULL DEFAULT '0', `IS_TEXT` INT(5) NOT NULL DEFAULT '0', `BRUTO_PRICE` DECIMAL(20,2) NOT NULL DEFAULT '0.00', `AMOUNT_DISCOUNT` DECIMAL(20,3) NOT NULL DEFAULT '0.000', `FROM_CONSTRUCTOR` INT(5) NOT NULL DEFAULT '0', `CHANGE_DATE` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', `BEREKENING_VALUE` INT(5) NOT NULL DEFAULT '0', `MAATVOERING_ID` BIGINT(250) NOT NULL DEFAULT '0', `KOZIJN_CALC_ID` BIGINT(250) NOT NULL DEFAULT '0', `IS_KOZIJN_CALC_TOTALS` INT(5) NOT NULL DEFAULT '0', `EAN_CODE` VARCHAR(150) DEFAULT NULL, `UURLOON_ID` BIGINT(20) NOT NULL DEFAULT '0', `ORG_PRICE_PER_UNIT` DECIMAL(50,3) NOT NULL DEFAULT '0.000', `ORG_CONTRACTOR_UNIT` DECIMAL(50,3) NOT NULL DEFAULT '0.000', `BTWCode` INT(5) NOT NULL DEFAULT '0', `IS_CONTROLE_GETAL` INT(5) NOT NULL DEFAULT '0', `AttentieRegel` INT(5) NOT NULL DEFAULT '0', `KozijnSelectionRowId` BIGINT(250) NOT NULL DEFAULT '0', `OfferteTekst` TEXT, `VerliesFactor` DECIMAL(15,4) NOT NULL DEFAULT '0.0000', PRIMARY KEY (`GROUP_LINE_ID`), KEY `GROUP_LINE_PARENT_ID` (`GROUP_LINE_PARENT_ID`), KEY `MOEDER_LINE_CODE` (`MOEDER_LINE_CODE`), KEY `CALC_ID` (`CALC_ID`), KEY `GROUP_ID` (`GROUP_ID`), KEY `MATERIAL_ID` (`MATERIAL_ID`), KEY `MAATVOERING_ID` (`MAATVOERING_ID`), KEY `KOZIJN_CALC_ID` (`KOZIJN_CALC_ID`), KEY `IS_KOZIJN_CALC_TOTALS` (`IS_KOZIJN_CALC_TOTALS`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
In my opinion the
- change table engine to InnoDB
- bigint(250) can be changed to int(10) of bigint(10)?
Please give me some advice