<?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&gt;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&gt;</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&gt;MySQL temporary tables are created either in memory (as &lt;code&gt;MEMORY&lt;/code&gt; tables) or on disk (as &lt;code&gt;MyISAM&lt;/code&gt; tables). How many tables went to disk and how many tables went to memory you can find with:&lt;/p&gt;</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&gt;&lt;code&gt;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&gt;&lt;/pre&gt;</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"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In his &lt;a href="http://www.primebase.org/download/pbxt-uc-2010.pdf" target="_blank"&gt;presentation&lt;/a&gt; about &lt;a href="http://www.primebase.com/" target="_blank"&gt;PBXT&lt;/a&gt; at the &lt;a href="http://www.doag.org/konferenz/doag/2010/" target="_blank"&gt;DOAG Conference 2010&lt;/a&gt; Paul McCullagh was speaking about &lt;a href="https://code.launchpad.net/~paul-mccullagh/pbxt/memory-tables" target="_blank"&gt;memory resident PBXT tables&lt;/a&gt;. 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"&gt;MySQL &lt;code&gt;MEMORY&amp;lt;/span&amp;gt; tables&amp;lt;/a&amp;gt;. But in addition to the &lt;/code&gt;MEMORY&lt;/span&gt; tables they are transactional and can handle &lt;code&gt;BLOB&amp;lt;/span&amp;gt; and &lt;/code&gt;TEXT&lt;/span&gt; attributes.&lt;/p&gt;</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"&gt;Table of Contents&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#temp_sequence"&gt;Result set with temporary sequence&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.fromdual.com/blog/mysql-hints/#prefixed_indexes"&gt;Determination of optimal length of prefixed indexes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.fromdual.com/blog/mysql-hints/#ddl"&gt;Using MySQL keywords in table or columm names&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.fromdual.com/blog/mysql-hints/#missing_pk_index"&gt;Missing Primary Key Index&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.fromdual.com/blog/mysql-hints/#libaio"&gt;Problems while installing a MySQL 5.5 database&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.fromdual.com/blog/mysql-hints/#sequence"&gt;InnoDB AUTO_INCREMENT at 2&lt;sup&gt;nd&lt;/sup&gt; position&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span id="temp_sequence"&gt;&lt;/span&gt;&lt;/p&gt;</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&gt;One of the big advantages of MySQL is its concept of &lt;strong&gt;Pluggable Storage Engines&lt;/strong&gt;. 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&gt;</description></item></channel></rss>