Created
April 8, 2021 00:14
-
-
Save bbrown/ce7fdfdd92bac987ebddbbbde5e9250e to your computer and use it in GitHub Desktop.
Exported Sequel Pro Query Favorites
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>encrypted</key> | |
<false/> | |
<key>format</key> | |
<string>query favorites</string> | |
<key>queryFavorites</key> | |
<array> | |
<dict> | |
<key>name</key> | |
<string>Process List</string> | |
<key>query</key> | |
<string>SHOW FULL PROCESSLIST;</string> | |
</dict> | |
<dict> | |
<key>name</key> | |
<string>Status</string> | |
<key>query</key> | |
<string>SHOW ENGINE INNODB STATUS;</string> | |
</dict> | |
<dict> | |
<key>name</key> | |
<string>Show Index Sizes</string> | |
<key>query</key> | |
<string>SELECT database_name, table_name, index_name, round(stat_value*@@innodb_page_size/1024/1024, 2) size_in_mb | |
FROM mysql.innodb_index_stats | |
WHERE stat_name = 'size' AND index_name != 'PRIMARY' | |
ORDER BY 4 DESC;</string> | |
</dict> | |
<dict> | |
<key>name</key> | |
<string>Find Columns</string> | |
<key>query</key> | |
<string>SELECT * FROM information_schema.columns | |
WHERE COLUMN_NAME LIKE '%${1:search}%' AND TABLE_SCHEMA = '${0:¦$SP_ASLIST_ALL_DATABASES¦}';</string> | |
<key>tabtrigger</key> | |
<string>FIND</string> | |
</dict> | |
<dict> | |
<key>name</key> | |
<string>Metadata Locks</string> | |
<key>query</key> | |
<string>UPDATE performance_schema.setup_instruments | |
SET enabled = 'YES' | |
WHERE name = 'wait/lock/metadata/sql/mdl';</string> | |
</dict> | |
<dict> | |
<key>name</key> | |
<string>Table Locks</string> | |
<key>query</key> | |
<string>SELECT | |
pl.id | |
,pl.user | |
,pl.state | |
,it.trx_id | |
,it.trx_mysql_thread_id | |
,it.trx_query AS query | |
,it.trx_id AS blocking_trx_id | |
,it.trx_mysql_thread_id AS blocking_thread | |
,it.trx_query AS blocking_query | |
FROM information_schema.processlist AS pl | |
INNER JOIN information_schema.innodb_trx AS it | |
ON pl.id = it.trx_mysql_thread_id | |
INNER JOIN information_schema.innodb_lock_waits AS ilw | |
ON it.trx_id = ilw.requesting_trx_id | |
AND it.trx_id = ilw.blocking_trx_id</string> | |
</dict> | |
<dict> | |
<key>name</key> | |
<string>Today's Slow Queries</string> | |
<key>query</key> | |
<string>SELECT * FROM mysql.slow_log WHERE start_time > CURDATE() ORDER BY start_time DESC;</string> | |
</dict> | |
<dict> | |
<key>name</key> | |
<string>Slow Queries</string> | |
<key>query</key> | |
<string>SELECT * FROM mysql.slow_log;</string> | |
</dict> | |
<dict> | |
<key>name</key> | |
<string>Slow Query Report</string> | |
<key>query</key> | |
<string>SELECT COUNT(1) AS total, sql_text, AVG(query_time) AS `avg`, MIN(query_time) AS `min`, MAX(query_time) AS `max`, MAX(start_time) AS last | |
FROM mysql.slow_log | |
GROUP BY sql_text | |
ORDER BY total DESC, avg DESC;</string> | |
</dict> | |
<dict> | |
<key>name</key> | |
<string>ibtmp1 Metadata</string> | |
<key>query</key> | |
<string>SELECT * FROM INFORMATION_SCHEMA.FILES WHERE TABLESPACE_NAME='innodb_temporary';</string> | |
</dict> | |
<dict> | |
<key>name</key> | |
<string>MySQL Uptime</string> | |
<key>query</key> | |
<string>SELECT TIME_FORMAT(SEC_TO_TIME(VARIABLE_VALUE ),'%Hh %im') AS uptime | |
FROM performance_schema.global_status WHERE VARIABLE_NAME='Uptime';</string> | |
</dict> | |
<dict> | |
<key>name</key> | |
<string>GI Blame</string> | |
<key>query</key> | |
<string>SELECT DISTINCT GIDesign.Name, username | |
FROM GIDesign LEFT JOIN Users ON GIDesign.CreatedByID = Users.PKID | |
WHERE GIDesign.CompanyID = 2;</string> | |
</dict> | |
<dict> | |
<key>name</key> | |
<string>Show MASTER status</string> | |
<key>query</key> | |
<string>SHOW MASTER STATUS;</string> | |
</dict> | |
<dict> | |
<key>name</key> | |
<string>Show REPLICA status</string> | |
<key>query</key> | |
<string>SHOW SLAVE STATUS;</string> | |
</dict> | |
<dict> | |
<key>name</key> | |
<string>Pending Transactions</string> | |
<key>query</key> | |
<string>SELECT * FROM information_schema.innodb_trx ORDER BY trx_started;</string> | |
</dict> | |
<dict> | |
<key>name</key> | |
<string>Locks by Transaction</string> | |
<key>query</key> | |
<string>SELECT * FROM information_schema.innodb_locks;</string> | |
</dict> | |
<dict> | |
<key>name</key> | |
<string>Calculate database sizes</string> | |
<key>query</key> | |
<string>SELECT table_schema "DB_Name", | |
ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "Total Size in MB", | |
ROUND(SUM(data_length) / 1024 / 1024, 1) "Data Size in MB", | |
ROUND(SUM(index_length) / 1024 / 1024, 1) "Index Size in MB" | |
FROM information_schema.tables | |
GROUP BY table_schema;</string> | |
</dict> | |
</array> | |
<key>version</key> | |
<integer>1</integer> | |
</dict> | |
</plist> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment