maria-discuss team mailing list archive
-
maria-discuss team
-
Mailing list archive
-
Message #05311
Re: Large query performance degrade after converting table from MyISAM to InnoDB
-
To:
<conor_mark_murphy@xxxxxxxxxxx>, <maria-discuss@xxxxxxxxxxxxxxxxxxx>
-
From:
<Rhys.Campbell@xxxxxxxxxxxx>
-
Date:
Tue, 11 Dec 2018 10:27:53 +0000
-
Accept-language:
en-GB, de-CH, en-US
-
In-reply-to:
<DB7PR04MB40573CDB98A88972C7C01F8AAEA60@DB7PR04MB4057.eurprd04.prod.outlook.com>
-
Msip_labels:
MSIP_Label_2e1fccfb-80ca-4fe1-a574-1516544edb53_Enabled=True; MSIP_Label_2e1fccfb-80ca-4fe1-a574-1516544edb53_SiteId=364e5b87-c1c7-420d-9bee-c35d19b557a1; MSIP_Label_2e1fccfb-80ca-4fe1-a574-1516544edb53_Owner=Rhys.Campbell@xxxxxxxxxxxx; MSIP_Label_2e1fccfb-80ca-4fe1-a574-1516544edb53_SetDate=2018-12-11T10:27:52.6425580Z; MSIP_Label_2e1fccfb-80ca-4fe1-a574-1516544edb53_Name=C2 Internal; MSIP_Label_2e1fccfb-80ca-4fe1-a574-1516544edb53_Application=Microsoft Azure Information Protection; MSIP_Label_2e1fccfb-80ca-4fe1-a574-1516544edb53_Extended_MSFT_Method=Automatic; Sensitivity=C2 Internal
-
Thread-index:
AQHUkKBmNuOvVN5kp0WEjSLb+BQ4MaV4KTIQgABZWoCAABv6gIAAtvCA
-
Thread-topic:
[Maria-discuss] Large query performance degrade after converting table from MyISAM to InnoDB
Can you put this is a proc and cycle through the list of partitions? I recall doing this a number of years ago and found this to be much faster than a single query.
Perhaps profiling the query can throw up some specifics...
https://mariadb.com/kb/en/library/information-schema-profiling-table/
From: Maria-discuss [mailto:maria-discuss-bounces+rhys.campbell=swisscom.com@xxxxxxxxxxxxxxxxxxx] On Behalf Of Conor Murphy
Sent: 11 December 2018 01:27
To: maria-discuss@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Maria-discuss] Large query performance degrade after converting table from MyISAM to InnoDB
Hi,
The explain for the MyISAM table is the same as what's given for the InnoDB version
+------+-------------+------------+-------+---------------+--------+---------+------+-----------+-------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+------+-------------+------------+-------+---------------+--------+---------+------+-----------+-------+
| 1 | SIMPLE | proc_stats | index | NULL | pidIdx | 2 | NULL | 956763463 | |
+------+-------------+------------+-------+---------------+--------+---------+------+-----------+-------+
I've only done a very basic tuning for InnoDB, i.e. give it a 24GB cache
innodb-file-per-table=1
innodb-buffer-pool-size=24G
innodb_buffer_pool_instances=12
The table holds time series data and the majority of queries on the table use the time column which allows the partition pruning to operate.However, this particular query is related to a nightly maintenance activity and ends up performing a full scan of the table. But this is the same for MyISAM which takes ~ 6 minutes to perform the query.
So cause of the ~ 14 hours must be something specific to InnoDB but I've no idea how to drill down to see what the issue with InnoDB is.
Thanks,
Conor
Follow ups
References