Skip to content

Commit 8bd4141

Browse files
committed
MAGETWO-99439: Exteremly slow removing from memory tables in GaleraDb
1 parent dc2e73a commit 8bd4141

File tree

4 files changed

+240
-0
lines changed

4 files changed

+240
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Bundle\Setup\Patch\Schema;
9+
10+
use Magento\Framework\Setup\Patch\SchemaPatchInterface;
11+
use Magento\Framework\Setup\SchemaSetupInterface;
12+
13+
class ChangeTmpTablesEngine implements SchemaPatchInterface
14+
{
15+
/**
16+
* @var SchemaSetupInterface
17+
*/
18+
private $schemaSetup;
19+
20+
/**
21+
* @param SchemaSetupInterface $schemaSetup
22+
*/
23+
public function __construct(SchemaSetupInterface $schemaSetup)
24+
{
25+
$this->schemaSetup = $schemaSetup;
26+
}
27+
28+
/**
29+
* @inheritdoc
30+
*/
31+
public function apply()
32+
{
33+
$this->schemaSetup->startSetup();
34+
35+
$tables = [
36+
'catalog_product_index_price_bundle_tmp',
37+
'catalog_product_index_price_bundle_sel_tmp',
38+
'catalog_product_index_price_bundle_opt_tmp',
39+
];
40+
foreach ($tables as $table) {
41+
$this->schemaSetup->getConnection()->changeTableEngine($table, 'InnoDB');
42+
}
43+
44+
$this->schemaSetup->endSetup();
45+
}
46+
47+
/**
48+
* @inheritdoc
49+
*/
50+
public static function getDependencies()
51+
{
52+
return [];
53+
}
54+
55+
/**
56+
* @inheritdoc
57+
*/
58+
public function getAliases()
59+
{
60+
return [];
61+
}
62+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Catalog\Setup\Patch\Schema;
9+
10+
use Magento\Framework\Setup\Patch\SchemaPatchInterface;
11+
use Magento\Framework\Setup\SchemaSetupInterface;
12+
13+
class ChangeTmpTablesEngine implements SchemaPatchInterface
14+
{
15+
/**
16+
* @var SchemaSetupInterface
17+
*/
18+
private $schemaSetup;
19+
20+
/**
21+
* @param SchemaSetupInterface $schemaSetup
22+
*/
23+
public function __construct(SchemaSetupInterface $schemaSetup)
24+
{
25+
$this->schemaSetup = $schemaSetup;
26+
}
27+
28+
/**
29+
* @inheritdoc
30+
*/
31+
public function apply()
32+
{
33+
$this->schemaSetup->startSetup();
34+
35+
$tables = [
36+
'catalog_product_index_price_cfg_opt_agr_tmp',
37+
'catalog_product_index_price_cfg_opt_tmp',
38+
'catalog_product_index_price_final_tmp',
39+
'catalog_product_index_price_opt_tmp',
40+
'catalog_product_index_price_opt_agr_tmp',
41+
'catalog_product_index_eav_tmp',
42+
'catalog_product_index_eav_decimal_tmp',
43+
'catalog_product_index_price_tmp',
44+
'catalog_category_product_index_tmp',
45+
];
46+
foreach ($tables as $table) {
47+
$this->schemaSetup->getConnection()->changeTableEngine($table, 'InnoDB');
48+
}
49+
50+
$this->schemaSetup->endSetup();
51+
}
52+
53+
/**
54+
* @inheritdoc
55+
*/
56+
public static function getDependencies()
57+
{
58+
return [];
59+
}
60+
61+
/**
62+
* @inheritdoc
63+
*/
64+
public function getAliases()
65+
{
66+
return [];
67+
}
68+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\CatalogInventory\Setup\Patch\Schema;
9+
10+
use Magento\Framework\Setup\Patch\SchemaPatchInterface;
11+
use Magento\Framework\Setup\SchemaSetupInterface;
12+
13+
class ChangeTmpTablesEngine implements SchemaPatchInterface
14+
{
15+
/**
16+
* @var SchemaSetupInterface
17+
*/
18+
private $schemaSetup;
19+
20+
/**
21+
* @param SchemaSetupInterface $schemaSetup
22+
*/
23+
public function __construct(SchemaSetupInterface $schemaSetup)
24+
{
25+
$this->schemaSetup = $schemaSetup;
26+
}
27+
28+
/**
29+
* @inheritdoc
30+
*/
31+
public function apply()
32+
{
33+
$this->schemaSetup->startSetup();
34+
35+
$this->schemaSetup->getConnection()->changeTableEngine('cataloginventory_stock_status_tmp', 'InnoDB');
36+
37+
$this->schemaSetup->endSetup();
38+
}
39+
40+
/**
41+
* @inheritdoc
42+
*/
43+
public static function getDependencies()
44+
{
45+
return [];
46+
}
47+
48+
/**
49+
* @inheritdoc
50+
*/
51+
public function getAliases()
52+
{
53+
return [];
54+
}
55+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Downloadable\Setup\Patch\Schema;
9+
10+
use Magento\Framework\Setup\Patch\SchemaPatchInterface;
11+
use Magento\Framework\Setup\SchemaSetupInterface;
12+
13+
class ChangeTmpTablesEngine implements SchemaPatchInterface
14+
{
15+
/**
16+
* @var SchemaSetupInterface
17+
*/
18+
private $schemaSetup;
19+
20+
/**
21+
* @param SchemaSetupInterface $schemaSetup
22+
*/
23+
public function __construct(SchemaSetupInterface $schemaSetup)
24+
{
25+
$this->schemaSetup = $schemaSetup;
26+
}
27+
28+
/**
29+
* @inheritdoc
30+
*/
31+
public function apply()
32+
{
33+
$this->schemaSetup->startSetup();
34+
35+
$this->schemaSetup->getConnection()->changeTableEngine('catalog_product_index_price_downlod_tmp', 'InnoDB');
36+
37+
$this->schemaSetup->endSetup();
38+
}
39+
40+
/**
41+
* @inheritdoc
42+
*/
43+
public static function getDependencies()
44+
{
45+
return [];
46+
}
47+
48+
/**
49+
* @inheritdoc
50+
*/
51+
public function getAliases()
52+
{
53+
return [];
54+
}
55+
}

0 commit comments

Comments
 (0)