Re: PG as in-memory db? How to warm up and re-populate buffers? How to read in all tuples into memory?

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: PG as in-memory db? How to warm up and re-populate buffers? How to read in all tuples into memory?
Date: 2012-02-26 11:46:03
Message-ID: jid61c$9fi$1@dough.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Stefan Keller wrote on 26.02.2012 01:16:
> 2. Are there any hints on how to tell Postgres to read in all table
> contents into memory?

What about creating tablespace on a RAM Fileystem (tmpfs), then create a second schema in your database where all tables are located in the that "temp" tablespace.

Then upon startup (or using triggers) you can copy all data from the persistent tables to the memory tables.

It would probably make sense to change the value of random_page_cost for that tablespace to 1

I'm not sure though how PostgreSQL handles a system-restart with tables on a tablespace that might not be there.

Thomas

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Jayashankar K B 2012-02-26 12:16:05 Re: Re: [PERFORM] Disable-spinlocks while compiling postgres 9.1 for ARM Cortex A8
Previous Message Stefan Keller 2012-02-26 10:56:44 Re: PG as in-memory db? How to warm up and re-populate buffers? How to read in all tuples into memory?