<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Memory Table on FromDual GmbH</title><link>https://www.fromdual.com/tags/memory-table/</link><description>Recent content in Memory Table on FromDual GmbH</description><generator>Hugo</generator><language>en-GB</language><managingEditor>oli.sennhauser@fromdual.com (Oli Sennhauser)</managingEditor><webMaster>oli.sennhauser@fromdual.com (Oli Sennhauser)</webMaster><copyright>© FromDual GmbH</copyright><lastBuildDate>Mon, 02 Aug 2021 10:38:03 +0000</lastBuildDate><atom:link href="https://www.fromdual.com/tags/memory-table/index.xml" rel="self" type="application/rss+xml"/><item><title>VSZ behaviour with MariaDB MEMORY tables</title><link>https://www.fromdual.com/blog/vsz-behaviour-with-mariadb-memory-tables/</link><pubDate>Tue, 05 Jan 2021 17:08:57 +0000</pubDate><author>oli.sennhauser@fromdual.com (Oli Sennhauser)</author><guid>https://www.fromdual.com/blog/vsz-behaviour-with-mariadb-memory-tables/</guid><description>&lt;p>We recently had the situation that a customer complained about the Oom killer terminating the MariaDB database instance from time to time. The MariaDB database configuration was sized quit OK (about 50% of RAM was used for the database) but they did not have swap configured.&lt;/p></description></item><item><title>MySQL tmpdir on RAM-disk</title><link>https://www.fromdual.com/blog/mysql-tmpdir-on-ram-disk/</link><pubDate>Thu, 15 Nov 2012 19:15:49 +0000</pubDate><author>oli.sennhauser@fromdual.com (Oli Sennhauser)</author><guid>https://www.fromdual.com/blog/mysql-tmpdir-on-ram-disk/</guid><description>&lt;p>MySQL temporary tables are created either in memory (as &lt;code>MEMORY&lt;/code> tables) or on disk (as &lt;code>MyISAM&lt;/code> tables). How many tables went to disk and how many tables went to memory you can find with:&lt;/p></description></item><item><title>Example 1</title><link>https://www.fromdual.com/blog/example-01/</link><pubDate>Fri, 09 Dec 2011 10:07:51 +0000</pubDate><author>oli.sennhauser@fromdual.com (Oli Sennhauser)</author><guid>https://www.fromdual.com/blog/example-01/</guid><description>&lt;pre>&lt;code>CREATE TABLE `order` (
 id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
, name VARCHAR(64) NOT NULL
) ENGINE = InnoDB;

INSERT INTO `order` VALUES
 (NULL, 'Test order 1')
, (NULL, 'Test order 2')
, (NULL, 'Test order 3');


CREATE TABLE pos (
 id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
, order_id INT UNSIGNED NOT NULL
, name VARCHAR(64) NOT NULL
, amount SMALLINT NOT NULL
, price DECIMAL (6,2) NOT NULL
, status TINYINT NULL
) ENGINE = InnoDB;

INSERT INTO pos VALUES
 (null, 1, 'Schrauben', 50, 0.10, 0)
, (null, 1, 'Muttern', 50, 0.10, 0)
, (null, 2, 'Nägel', 1000, 0.05, 1);


CREATE TABLE pos_shadow LIKE pos;
ALTER TABLE pos_shadow ENGINE = MEMORY;
INSERT INTO pos_shadow SELECT * FROM pos;

delimiter //

CREATE TRIGGER upd BEFORE UPDATE ON pos
FOR EACH ROW
BEGIN
 UPDATE pos_shadow AS p
 JOIN `order` AS o ON o.id = p.order_id and o.id = NEW.order_id
 SET status = 1
 WHERE o.id = 1;
END;
//

delimiter ;

SELECT o.name, p.name, p.amount, p.price, (p.amount*p.price) AS total, p. status
 FROM `order` AS o
 JOIN pos_shadow AS p ON p.order_id = o.id
;

UPDATE pos AS p
 JOIN `order` AS o ON o.id = p.order_id AND o.id = 1
 SET p.status = 1, p.order_id = 1
 where o.id = 1;

SELECT o.name, p.name, p.amount, p.price, (p.amount*p.price) AS total, p. status
 FROM `order` AS o
 JOIN pos AS p on p.order_id = o.id
;
&lt;/code>&lt;/pre></description></item><item><title>Transactional memory resident tables with PBXT</title><link>https://www.fromdual.com/blog/transactional-memory-resident-tables-with-pbxt/</link><pubDate>Sun, 21 Nov 2010 21:32:18 +0000</pubDate><author>oli.sennhauser@fromdual.com (Oli Sennhauser)</author><guid>https://www.fromdual.com/blog/transactional-memory-resident-tables-with-pbxt/</guid><description>&lt;h2 id="introduction">Introduction&lt;/h2>
&lt;p>In his &lt;a href="http://www.primebase.org/download/pbxt-uc-2010.pdf" target="_blank">presentation&lt;/a> about &lt;a href="http://www.primebase.com/" target="_blank">PBXT&lt;/a> at the &lt;a href="http://www.doag.org/konferenz/doag/2010/" target="_blank">DOAG Conference 2010&lt;/a> Paul McCullagh was speaking about &lt;a href="https://code.launchpad.net/~paul-mccullagh/pbxt/memory-tables" target="_blank">memory resident PBXT tables&lt;/a>. They will be available in version 1.1 of the PBXT Storage Engine Plugin. Memory resident PBXT tables should have similar characteristics like normal &lt;a href="http://dev.mysql.com/doc/refman/5.1/en/memory-storage-engine.html" target="_blank">MySQL &lt;code>MEMORY&amp;lt;/span&amp;gt; tables&amp;lt;/a&amp;gt;. But in addition to the &lt;/code>MEMORY&lt;/span> tables they are transactional and can handle &lt;code>BLOB&amp;lt;/span&amp;gt; and &lt;/code>TEXT&lt;/span> attributes.&lt;/p></description></item><item><title>MySQL hints</title><link>https://www.fromdual.com/blog/mysql-hints/</link><pubDate>Mon, 15 Mar 2010 13:38:54 +0000</pubDate><author>oli.sennhauser@fromdual.com (Oli Sennhauser)</author><guid>https://www.fromdual.com/blog/mysql-hints/</guid><description>&lt;h2 id="table-of-contents">Table of Contents&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="#temp_sequence">Result set with temporary sequence&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://www.fromdual.com/blog/mysql-hints/#prefixed_indexes">Determination of optimal length of prefixed indexes&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://www.fromdual.com/blog/mysql-hints/#ddl">Using MySQL keywords in table or columm names&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://www.fromdual.com/blog/mysql-hints/#missing_pk_index">Missing Primary Key Index&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://www.fromdual.com/blog/mysql-hints/#libaio">Problems while installing a MySQL 5.5 database&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://www.fromdual.com/blog/mysql-hints/#sequence">InnoDB AUTO_INCREMENT at 2&lt;sup>nd&lt;/sup> position&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>&lt;span id="temp_sequence">&lt;/span>&lt;/p></description></item><item><title>MySQL pluggable Storage Engines (SE)</title><link>https://www.fromdual.com/blog/mysql-pluggable-storage-engines/</link><pubDate>Thu, 11 Mar 2010 23:20:51 +0000</pubDate><author>oli.sennhauser@fromdual.com (Oli Sennhauser)</author><guid>https://www.fromdual.com/blog/mysql-pluggable-storage-engines/</guid><description>&lt;p>One of the big advantages of MySQL is its concept of &lt;strong>Pluggable Storage Engines&lt;/strong>. This means you can choose the most optimal Storage Engine for your needs. This also has a disadvantage: You have to know what you are doing&amp;hellip;&lt;/p></description></item></channel></rss>