MySQL Forums
Forum List  »  InnoDB

Re: Innodb full table scan if query return 0 rows
Posted by: thomas schiavello
Date: August 25, 2016 01:31AM

CREATE TABLE `datas` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`created` datetime(4) NOT NULL COMMENT 'data e ora',
`plug` int(11) NOT NULL COMMENT 'presa',
`corrente_fase_1` float DEFAULT NULL,
`corrente_fase_2` float DEFAULT NULL,
`corrente_fase_3` float DEFAULT NULL,
`tensione_v1_2` float DEFAULT NULL,
`tensione_v2_3` float DEFAULT NULL,
`tensione_v3_1` float DEFAULT NULL,
`potenza_attiva_istantanea_w_100` float DEFAULT NULL,
`potenza_reattiva_istantanea_var_100` float DEFAULT NULL,
`totale_potenza_attiva_kwh_100` float DEFAULT NULL,
`totale_potenza_reattiva_kvarh_100` float DEFAULT NULL,
`fattore_potenza_cos_fi` float DEFAULT NULL,
`frequenza_hz_10` float DEFAULT NULL,
`picco_massimo_richiesto_w_100` float DEFAULT NULL,
`euro_acqua_lt_totali_app_gg` float DEFAULT NULL,
`euro_gas_sm3_totali_app_gg` float DEFAULT NULL,
`acqua_lt_totali_app_gg` float DEFAULT NULL,
`gas_sm3_totali_app_gg` float DEFAULT NULL,
`potenza_attiva_kwh_gg_app` float DEFAULT NULL,
`potenza_reattiva_kvarh_gg_app` float DEFAULT NULL,
`euro_kwh_gg` float DEFAULT NULL,
`euro_kvarh_gg` float DEFAULT NULL,
`allarme_v1_up` float DEFAULT NULL,
`allarme_v2_up` float DEFAULT NULL,
`allarme_v3_up` float DEFAULT NULL,
`allarme_v1_down` float DEFAULT NULL,
`allarme_v2_down` float DEFAULT NULL,
`allarme_v3_down` float DEFAULT NULL,
`allarme_i1_up` float DEFAULT NULL,
`allarme_i2_up` float DEFAULT NULL,
`allarme_i3_up` float DEFAULT NULL,
`allarme_frequenza_up` float DEFAULT NULL,
`allarme_frequenza_down` float DEFAULT NULL,
`allarme_cos_fi_down` float DEFAULT NULL,
`corrente_nominale` float DEFAULT NULL,
`euro_totale_app_totale` float DEFAULT NULL,
`euro_kwh_app_totale` float DEFAULT NULL,
`euro_kvarh_app_totale` float DEFAULT NULL,
`euro_acqua_app_totale` float DEFAULT NULL,
`euro_gas_app_totale` float DEFAULT NULL,
`orario_app_totale` varchar(255) DEFAULT NULL,
`kwh_app_totale` float DEFAULT NULL,
`kvarh_app_totale` float DEFAULT NULL,
`acqua_app_totale` float DEFAULT NULL,
`gas_app_totale` float DEFAULT NULL,
`orario_forzatura_on` float DEFAULT NULL,
`orario_forzatura_off` float DEFAULT NULL,
`letture_nel_periodo` int(11) DEFAULT NULL,
`orario_prima_forzatura` float DEFAULT NULL,
`orario_seconda_forzatura` float DEFAULT NULL,
`orario_terza_forzatura` float DEFAULT NULL,
`orario_quarta_forzatura` float DEFAULT NULL,
`orario_quinta_forzatura` float DEFAULT NULL,
`orario_sesta_forzatura` float DEFAULT NULL,
`inutilizzata` float DEFAULT NULL,
`tempo_prima_forzatura` float DEFAULT NULL,
`tempo_seconda_forzatura` float DEFAULT NULL,
`tempo_terza_forzatura` float DEFAULT NULL,
`tempo_quarta_forzatura` float DEFAULT NULL,
`tempo_quinta_forzatura` float DEFAULT NULL,
`tempo_sesta_forzatura` float DEFAULT NULL,
`min_sec_taglio_picchi_presa_1` float DEFAULT NULL,
`min_sec_taglio_picchi_presa_2` float DEFAULT NULL,
`min_sec_taglio_picchi_presa_3` float DEFAULT NULL,
`min_sec_taglio_picchi_presa_4` float DEFAULT NULL,
`min_sec_taglio_picchi_presa_5` float DEFAULT NULL,
`min_sec_taglio_picchi_presa_6` float DEFAULT NULL,
`min_sec_taglio_picchi_presa_7` float DEFAULT NULL,
`min_sec_taglio_picchi_presa_8` float DEFAULT NULL,
`min_sec_taglio_picchi_presa_9` float DEFAULT NULL,
`min_sec_taglio_picchi_presa_10` float DEFAULT NULL,
`min_sec_taglio_picchi_presa_11` float DEFAULT NULL,
`min_sec_taglio_picchi_presa_12` float DEFAULT NULL,
`min_sec_taglio_picchi_presa_13` float DEFAULT NULL,
`min_sec_taglio_picchi_presa_14` float DEFAULT NULL,
`min_sec_taglio_picchi_presa_15` float DEFAULT NULL,
`min_sec_taglio_picchi_presa_16` float DEFAULT NULL,
`min_sec_taglio_picchi_presa_17` float DEFAULT NULL,
`min_sec_taglio_picchi_presa_18` float DEFAULT NULL,
`min_sec_taglio_picchi_presa_19` float DEFAULT NULL,
`totale_locale_1000` float DEFAULT NULL COMMENT ' ',
`kwh_totale_locale_1000` float DEFAULT NULL,
`kvarh_totale_locale_1000` float DEFAULT NULL,
`acqua_totale_locale_1000` float DEFAULT NULL,
`gas_totale_locale_1000` float DEFAULT NULL,
`totale_giornaliero_locale_1000` float DEFAULT NULL,
`kwh_giornaliero_locale_1000` float DEFAULT NULL,
`kvarh_giornaliero_locale_1000` float DEFAULT NULL,
`acqua_giornaliero_locale_1000` float DEFAULT NULL,
`gas_giornaliero_locale_1000` float DEFAULT NULL,
`tempo_totale_locale` float DEFAULT NULL,
`kwh_totale_locale` float DEFAULT NULL,
`kvarh_totale_locale` float DEFAULT NULL,
`acqua_totale_locale` float DEFAULT NULL,
`gas_totale_locale` float DEFAULT NULL,
`tempo_giornaliero_locale` float DEFAULT NULL,
`kwh_giornaliero_locale` float DEFAULT NULL,
`kvarh_giornaliero_locale` float DEFAULT NULL,
`acqua_giornaliero_locale` float DEFAULT NULL,
`gas_giornaliero_locale` float DEFAULT NULL,
`potenza_attiva_istantanea_minuto_1` float DEFAULT NULL,
`potenza_attiva_istantanea_minuto_2` float DEFAULT NULL,
`potenza_attiva_istantanea_minuto_3` float DEFAULT NULL,
`picco_massimo_richiesto_w_100_generale` float DEFAULT NULL,
`corrente_fase_1_generale` float DEFAULT NULL,
`corrente_fase_2_generale` float DEFAULT NULL,
`corrente_fase_3_generale` float DEFAULT NULL,
`potenza_attiva_istantanea` float DEFAULT NULL,
`potenza_reattiva_istantanea` float DEFAULT NULL,
`totale_potenza_attiva` float DEFAULT NULL,
`totale_potenza_reattiva` float DEFAULT NULL,
`cos_fi` float DEFAULT NULL,
`frequenza` float DEFAULT NULL,
`tensione_concatenata_v1_2` float DEFAULT NULL,
`tensione_concatenata_v2_3` float DEFAULT NULL,
`tensione_concatenata_v3_1` float DEFAULT NULL,
`force_status` tinyint(1) DEFAULT NULL,
`force_on_time` datetime DEFAULT NULL,
`force_off_time` datetime DEFAULT NULL,
`temperatura_1` float DEFAULT NULL,
`temperatura_2` float DEFAULT NULL,
`temperatura_3` float DEFAULT NULL,
`temperatura_4` float DEFAULT NULL,
`temperatura_5` float DEFAULT NULL,
`temperatura_6` float DEFAULT NULL,
`temperatura_7` float DEFAULT NULL,
`temperatura_8` float DEFAULT NULL,
`temperatura_9` float DEFAULT NULL,
`temperatura_10` float DEFAULT NULL,
`serial_off` int(11) DEFAULT NULL,
`switch_on` tinyint(1) DEFAULT NULL,
`switch_on_time` varchar(15) DEFAULT NULL,
`rele_forced_status` tinyint(1) DEFAULT NULL,
`tp_status` tinyint(1) DEFAULT NULL,
`tp_on_time` datetime DEFAULT NULL,
`tp_off_time` datetime DEFAULT NULL,
`delivery_status` tinyint(1) DEFAULT NULL,
`delivery_on_time` datetime DEFAULT NULL,
`delivery_off_time` datetime DEFAULT NULL,
`corrente_nominale_i1` float DEFAULT NULL,
`corrente_nominale_i2` float DEFAULT NULL,
`corrente_nominale_i3` float DEFAULT NULL,
PRIMARY KEY (`id`,`plug`),
KEY `data_created` (`created`),
KEY `data_plug_created` (`created`,`plug`) USING BTREE,
KEY `data_test_index_plug_created` (`plug`,`created`)
) ENGINE=InnoDB AUTO_INCREMENT=486442139 DEFAULT CHARSET=utf8
/*!50100 PARTITION BY KEY (plug)
PARTITIONS 100 */;

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Innodb full table scan if query return 0 rows
830
August 25, 2016 01:31AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.