Skip to content

Instantly share code, notes, and snippets.

View aabumuslimov's full-sized avatar

Andrey Abumuslimov aabumuslimov

  • Adobe
  • Los Angeles, CA
View GitHub Profile
@aabumuslimov
aabumuslimov / MySQL expected memory allocation
Last active May 29, 2025 22:42
MySQL expected memory allocation
SELECT ROUND((
@@GLOBAL.key_buffer_size
+ @@GLOBAL.query_cache_size
+ @@GLOBAL.tmp_table_size
+ @@GLOBAL.innodb_buffer_pool_size
+ @@GLOBAL.innodb_log_buffer_size
+ @@GLOBAL.max_connections
* (
@@GLOBAL.sort_buffer_size
+ @@GLOBAL.read_buffer_size
(SELECT "DB Total" AS "Table",
'' AS 'Engine',
ROUND(SUM(data_length) / 1048576) AS 'Data',
ROUND(SUM(index_length) / 1048576) AS 'Index',
ROUND(SUM(data_length + index_length) / 1048576) AS 'Total',
ROUND(SUM(data_free) / 1048576) AS 'Free'
FROM information_schema.TABLES
WHERE table_schema = DATABASE())
UNION ALL
(SELECT
@aabumuslimov
aabumuslimov / Magento1 indexers healthcheck
Last active March 9, 2017 10:17
Magento1 indexers healthcheck
SELECT m.metadata_id, m.table_name, m.changelog_name, IF(ccd.value = 1, "On Save", "Scheduled") AS "Mode", m.version_id AS "Processed version", v.version_id AS "Changelog version"
, CAST(v.version_id AS SIGNED) - CAST(m.version_id AS SIGNED) AS "Behind"
FROM (
(SELECT "enterprise_url_rewrite_redirect_cl" AS changelog_name, "index_management/index_options/redirect_url_rewrite" AS path, version_id FROM enterprise_url_rewrite_redirect_cl ORDER BY version_id DESC LIMIT 1)
UNION (SELECT "cataloginventory_stock_status_cl", "index_management/index_options/product_price_and_stock", version_id FROM cataloginventory_stock_status_cl ORDER BY version_id DESC LIMIT 1)
UNION (SELECT "catalogsearch_fulltext_cl", "index_management/index_options/fulltext", version_id FROM catalogsearch_fulltext_cl ORDER BY version_id DESC LIMIT 1)
UNION (SELECT "enterprise_url_rewrite_category_cl", "index_management/index_options/category_url_rewrite", version_id FROM enterprise_url_rewrite_category_cl ORDER BY version_id DESC LIMIT 1)
UNION