May 26, 2012

Post: Troubleshooting MySQL Memory Usage

… see MySQL memory consumption plotted. I use “VSZ” columns from “ps…and not): mysql> select * from information_schema.global_temporary_tables \G *************************** 1. rowswapped out and when never needed again. So if you see swap file used space gradually growing and there are “swap

Post: PHP Large result sets and summary tables.

and was swapping development server which had just 4GB of Ram (and plenty of swap space) like crazy. Why ? Because by default mysql_query uses mysql… run mysql_query , mysql_fetch_row simply reads data from memory and …increment column and fetch data from this table using auto increment column ranges…

Post: How much overhead is caused by on disk temporary tables

and also by the data which needs to be put to temporary tables – BLOB/TEXT columns… 10 rows in set (27 min 5.51 sec) VMSTAT: procs ———–memory———- —swaprows in set ( 3.88 sec) Wow. This is great difference even from our best MyISAM results. For 4M of rows mysql

Post: Faster Point In Time Recovery with LVM2 Snaphots and Binary Logs

rows affected (0.15 sec) mysql> drop table salaries; — Ooops! Query OK, 0 rows affected (0.49 sec) mysql> alter table employees add column

Post: Implementing efficient counters with MySQL

and “counter” columns. Using separate table for updates already solves the problem in a lot of cases, and…just mentioned would have approximately 20 byte rows even for Innodb tables which makes …into one and process and truncate another. MySQL offers atomic RENAME TABLE call which can be used to swap

Post: Impact of the sort buffer size in MySQL

column without an index: CREATE TABLE `sorttest` ( `data` char(30) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 and I inserted 100k rows… the whole process, the computer never swapped and I pre-warmed the file cache … least for the Linux, glibc and MySQL versions I used and for the test I did, …

Post: Heikki Tuuri Innodb answers - Part I

…this with care: you MUST use row-based binlogging and replication, and remember that the execution is not serializable…. decide (incorrectly) to swap out MySQL. There are two solutions here. Memlock and O_DIRECT. Memlock is …: it can be used if the columns are the first columns in an index. I think …

Comment: MySQL Server Memory Usage

…% available, MPM and dual…collations’, ’176788′ ‘Com_show_column_types’, ’0′ ‘… ‘Sort_range’, ’56479689′ ‘Sort_rows‘, ’1344092495′ ‘Sort_scan’, ‘… in_c Swap: 4194224k av…mysql.sock pid-file=/var/run/mysql/mysql.pid datadir=/db/disk2/mysql/data log-bin=/var/log/mysql/log log-slow-queries=/var/log/mysql

Post: Memory allocation in Stored Function

… time ago I had task to update string column in table with 10mil+ rows, and, as the manipulation was non-trivial, I decided… check only select: mysql> select avg(length(hello(name))) from testf; and here is vmstat 5 output: procs ———–memory———- —swap– —–io—- –system– —-cpu…