<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Memory Engine &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/memory-engine/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Mon, 09 Apr 2018 18:39:20 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>
	<item>
		<title>PostgreSQL: Load table into Buffer Cache, Increase the Speed of Accessing data</title>
		<link>https://www.dbrnd.com/2018/04/postgresql-load-table-into-buffer-cache-increase-the-speed-of-accessing-data-pg_prewarm/</link>
					<comments>https://www.dbrnd.com/2018/04/postgresql-load-table-into-buffer-cache-increase-the-speed-of-accessing-data-pg_prewarm/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sun, 08 Apr 2018 16:16:20 +0000</pubDate>
				<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[Buffer Cache]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Memory Engine]]></category>
		<category><![CDATA[pg_prewarm]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[Postgres Query]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL Administrator]]></category>
		<category><![CDATA[PostgreSQL Error]]></category>
		<category><![CDATA[PostgreSQL Monitoring]]></category>
		<category><![CDATA[PostgreSQL Performance]]></category>
		<category><![CDATA[PostgreSQL Performance Tuning]]></category>
		<category><![CDATA[PostgreSQL Programming]]></category>
		<category><![CDATA[PostgreSQL Tips and Tricks]]></category>
		<category><![CDATA[Table Performance]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7351</guid>

					<description><![CDATA[<div><img width="675" height="400" src="https://www.dbrnd.com/wp-content/uploads/2017/12/SQLRam.jpg" class="attachment-post-image size-post-image wp-post-image" alt="SQLRam" decoding="async" fetchpriority="high" /></div>In this post, I am sharing a demonstration on how to load a table data into the Buffer Cache of PostgreSQL? If your table available in the Buffer Cache, you can reduce the cost of DISK I/O. The similar feature of Memory Engine or Database In-Memory concept. But this is not always good, because compare [&#8230;]]]></description>
										<content:encoded><![CDATA[<div><img width="675" height="400" src="https://www.dbrnd.com/wp-content/uploads/2017/12/SQLRam.jpg" class="attachment-post-image size-post-image wp-post-image" alt="SQLRam" decoding="async" /></div><p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F04%2Fpostgresql-load-table-into-buffer-cache-increase-the-speed-of-accessing-data-pg_prewarm%2F&amp;linkname=PostgreSQL%3A%20Load%20table%20into%20Buffer%20Cache%2C%20Increase%20the%20Speed%20of%20Accessing%20data" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F04%2Fpostgresql-load-table-into-buffer-cache-increase-the-speed-of-accessing-data-pg_prewarm%2F&amp;linkname=PostgreSQL%3A%20Load%20table%20into%20Buffer%20Cache%2C%20Increase%20the%20Speed%20of%20Accessing%20data" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F04%2Fpostgresql-load-table-into-buffer-cache-increase-the-speed-of-accessing-data-pg_prewarm%2F&amp;linkname=PostgreSQL%3A%20Load%20table%20into%20Buffer%20Cache%2C%20Increase%20the%20Speed%20of%20Accessing%20data" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F04%2Fpostgresql-load-table-into-buffer-cache-increase-the-speed-of-accessing-data-pg_prewarm%2F&amp;linkname=PostgreSQL%3A%20Load%20table%20into%20Buffer%20Cache%2C%20Increase%20the%20Speed%20of%20Accessing%20data" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F04%2Fpostgresql-load-table-into-buffer-cache-increase-the-speed-of-accessing-data-pg_prewarm%2F&amp;linkname=PostgreSQL%3A%20Load%20table%20into%20Buffer%20Cache%2C%20Increase%20the%20Speed%20of%20Accessing%20data" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F04%2Fpostgresql-load-table-into-buffer-cache-increase-the-speed-of-accessing-data-pg_prewarm%2F&amp;linkname=PostgreSQL%3A%20Load%20table%20into%20Buffer%20Cache%2C%20Increase%20the%20Speed%20of%20Accessing%20data" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F04%2Fpostgresql-load-table-into-buffer-cache-increase-the-speed-of-accessing-data-pg_prewarm%2F&#038;title=PostgreSQL%3A%20Load%20table%20into%20Buffer%20Cache%2C%20Increase%20the%20Speed%20of%20Accessing%20data" data-a2a-url="https://www.dbrnd.com/2018/04/postgresql-load-table-into-buffer-cache-increase-the-speed-of-accessing-data-pg_prewarm/" data-a2a-title="PostgreSQL: Load table into Buffer Cache, Increase the Speed of Accessing data"></a></p><p>In this post, I am sharing a demonstration on how to load a table data into the Buffer Cache of PostgreSQL? </p>
<p>If your table available in the Buffer Cache, you can reduce the cost of DISK I/O. The similar feature of Memory Engine or Database In-Memory concept. </p>
<blockquote><p>But this is not always good, because compare to DISK we have always the limited size of Memory and memory is also require of OS. But in some special cases, we can load frequently used table into Buffer Cache of PostgreSQL.</p>
<p>Before loading any table into the Buffer Cache, you must check the size of the table and the available size of Buffer Cache. </p></blockquote>
<p>Using pg_prewarm module we can do this. It provides a convenient way to load relation data into either the operating system buffer cache or the PostgreSQL buffer cache. </p>
<blockquote><p><em>Once you perform the below test, next question would be &#8220;How to check the status of Buffer Cache for each table?&#8221;<br />
Please visit tomorrow&#8217;s article for this solution&#8230;</em></p>
<blockquote class="wp-embedded-content" data-secret="xJerMADuzu"><p><a href="https://www.dbrnd.com/2018/04/postgresql-script-to-check-the-status-of-shared-buffer-use-pg_buffercache/">PostgreSQL: Script to check the status of Shared Buffer (Use pg_buffercache)</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2018/04/postgresql-script-to-check-the-status-of-shared-buffer-use-pg_buffercache/embed/#?secret=xJerMADuzu" data-secret="xJerMADuzu" width="600" height="338" title="&#8220;PostgreSQL: Script to check the status of Shared Buffer (Use pg_buffercache)&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
</p></blockquote>
<p><strong>Please check the below demonstration:</strong></p>
<p><strong>Create two sample tables:</strong></p>
<pre class="crayon-plain-tag">CREATE TABLE tbl_ItemTransactions_1
 (
     TranID SERIAL
     ,TransactionDate TIMESTAMPTZ
     ,TransactionName TEXT
 );
 
INSERT INTO tbl_ItemTransactions_1
(TransactionDate, TransactionName)
SELECT x, 'dbrnd' 
FROM generate_series('2010-01-01 00:00:00'::timestamptz, '2018-02-01 00:00:00'::timestamptz,'1 minutes'::interval) a(x);

CREATE TABLE tbl_ItemTransactions_2
 (
     TranID SERIAL
     ,TransactionDate TIMESTAMPTZ
     ,TransactionName TEXT
 );
 
INSERT INTO tbl_ItemTransactions_2
(TransactionDate, TransactionName)
SELECT x, 'dbrnd' 
FROM generate_series('2010-01-01 00:00:00'::timestamptz, '2018-02-01 00:00:00'::timestamptz,'1 minutes'::interval) a(x);</pre> </p>
<p><strong>Create pg_prewarm extension:</strong></p>
<pre class="crayon-plain-tag">CREATE EXTENSION pg_prewarm;</pre> </p>
<p><strong>Now, prefatch the tbl_ItemTransactions_1 table using pg_prewarm:</strong></p>
<pre class="crayon-plain-tag">SELECT pg_prewarm('tbl_ItemTransactions_1');</pre> </p>
<p><strong>Check the execution plan of tbl_ItemTransactions_1:</strong><br />
The execution plan of prefatched table is quite faster than normal table. </p>
<pre class="crayon-plain-tag">EXPLAIN ANALYZE SELECT *FROM tbl_ItemTransactions_1;

Planning time: 0.130 ms
Execution time: 356.237 ms</pre> </p>
<p><strong>Check the execution plan of tbl_ItemTransactions_2:</strong></p>
<pre class="crayon-plain-tag">EXPLAIN ANALYZE SELECT *FROM tbl_ItemTransactions_2;

Planning time: 0.210 ms
Execution time: 752.010 ms</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2018/04/postgresql-load-table-into-buffer-cache-increase-the-speed-of-accessing-data-pg_prewarm/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>The Memory or Heap Storage Engine of MySQL</title>
		<link>https://www.dbrnd.com/2015/08/the-memory-or-heap-storage-engine-of-mysql/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 15 Aug 2015 20:06:12 +0000</pubDate>
				<category><![CDATA[Database Theory]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[.frm]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[heap table]]></category>
		<category><![CDATA[Memory Engine]]></category>
		<category><![CDATA[MySQL Command]]></category>
		<category><![CDATA[MySQL Database Administrator]]></category>
		<category><![CDATA[MySQL Database Designing]]></category>
		<category><![CDATA[MySQL Database Programming]]></category>
		<category><![CDATA[MySQL Error]]></category>
		<category><![CDATA[MySQL Performance Tunning]]></category>
		<category><![CDATA[MySQL Query]]></category>
		<category><![CDATA[MySQL Tips and Tricks]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=405</guid>

					<description><![CDATA[In the previous post, I had explained the basic theory on the Heap Table of Database Technology. In this post, I am going to explain the Heap table terminology of MySQL. MySQL Memory Storage Engine also called as Heap Storage structure. Using Memory Storage Engine, you can store a table of data in server memory [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F08%2Fthe-memory-or-heap-storage-engine-of-mysql%2F&amp;linkname=The%20Memory%20or%20Heap%20Storage%20Engine%20of%20MySQL" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F08%2Fthe-memory-or-heap-storage-engine-of-mysql%2F&amp;linkname=The%20Memory%20or%20Heap%20Storage%20Engine%20of%20MySQL" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F08%2Fthe-memory-or-heap-storage-engine-of-mysql%2F&amp;linkname=The%20Memory%20or%20Heap%20Storage%20Engine%20of%20MySQL" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F08%2Fthe-memory-or-heap-storage-engine-of-mysql%2F&amp;linkname=The%20Memory%20or%20Heap%20Storage%20Engine%20of%20MySQL" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F08%2Fthe-memory-or-heap-storage-engine-of-mysql%2F&amp;linkname=The%20Memory%20or%20Heap%20Storage%20Engine%20of%20MySQL" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F08%2Fthe-memory-or-heap-storage-engine-of-mysql%2F&amp;linkname=The%20Memory%20or%20Heap%20Storage%20Engine%20of%20MySQL" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F08%2Fthe-memory-or-heap-storage-engine-of-mysql%2F&#038;title=The%20Memory%20or%20Heap%20Storage%20Engine%20of%20MySQL" data-a2a-url="https://www.dbrnd.com/2015/08/the-memory-or-heap-storage-engine-of-mysql/" data-a2a-title="The Memory or Heap Storage Engine of MySQL"></a></p><p>In the previous post, I had explained the basic theory on the Heap Table of Database Technology.<br />
In this post, I am going to explain the Heap table terminology of MySQL.</p>
<blockquote><p>MySQL Memory Storage Engine also called as Heap Storage structure.</p></blockquote>
<p>Using Memory Storage Engine, you can store a table of data in server memory for fast retrieval.<br />
This table of data also supports B-Tree index so you can get a result in a best-optimized way. Auto_Increment also supported by the Tables of Memory Engine.</p>
<p>There might be chances of loss data when any hardware crashes or power outage of Server Memory.</p>
<blockquote><p>You can store and use only those data which are in temporary use and make sure that data in memory engine has always back up in physical stored table.</p></blockquote>
<p><strong>When to use Memory Engine of MySQL ?</strong></p>
<blockquote><p>If data are non-critical, need fast retrieval and only for read-only access with a minimum of updates.<br />
The volume of data can be fit into Memory area because it internally uses the swap out of virtual memory pages.</p></blockquote>
<p><strong>Brief details of Memory Engine Mechanism: </strong></p>
<blockquote><p>The table of Memory Engine stores it&#8217;s table definition into one disk file, and extension of this file is  .frm.<br />
All other data stores in a specified area of memory.<br />
The data in memory table is not only for one single connection, it is available for all running related connections and sessions of MySQL Server.</p></blockquote>
<p><strong>Create sample table using Memory Engine:</strong></p><pre class="crayon-plain-tag">CREATE TABLE Test (TestNo INT,TestName VARCHAR(50)) ENGINE = MEMORY;</pre><p>
This all basic about MySQL Memory or Heap Engine.</p>
<hr />
<p>Any confusion, like difference between Temporary table and Memory table.<br />
<a href="https://www.dbrnd.com/2015/08/mysql-temporary-table-vs-memory-table/" target="_blank">If yes, then please visit next post.</a></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
