Re: create table in memory

From: Seref Arikan <serefarikan(at)gmail(dot)com>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: Peter Kroon <plakroon(at)gmail(dot)com>, Raghavendra <raghavendra(dot)rao(at)enterprisedb(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: create table in memory
Date: 2012-11-27 15:44:02
Message-ID: CA+4ThdqgF1JnQsk3PP_nvR339hdCgPyJzCd4yjJSkb1VZ7qQnA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Merlin,
See below please

On Tue, Nov 27, 2012 at 3:29 PM, Merlin Moncure <mmoncure(at)gmail(dot)com> wrote:

> On Fri, Nov 23, 2012 at 4:09 AM, Peter Kroon <plakroon(at)gmail(dot)com> wrote:
> > I've put up a small test case for creating TEMP and UNLOGGED tables.
> > DROP TABLE IF EXISTS test CASCADE;
> > CREATE TEMP TABLE test(
> > id serial,
> > the_value text
> > );
> > Exec time: 54ms
> >
> > DROP TABLE IF EXISTS test CASCADE;
> > CREATE UNLOGGED TABLE test(
> > id serial,
> > the_value text
> > );
> > Exec time: 198ms
> >
> > There is a significant difference.
> >
> > Also I need those tables per session, so creating and dropping with TEMP
> > tables appear to be faster.
>
> Performance of creating tables is going to be storage bound. what are
> your performance requirements? Even if the temp table itself is moved
> to ramdisk you have catalog updating. Usually from performance
> standpoint, creation of temp tables is not interesting -- but there
> are exceptions. If you need extremely fast creation/drop of tempe
> tables, you probably need to reorganize into permanent table with
> session local records using various tricks.
>

I am very interested in what you've written in the last sentence above,
since it is exactly what my requirement is. Could you explain that a bit
more?

Best regards
Seref

>
> merlin
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2012-11-27 15:50:51 Re: create table in memory
Previous Message Hari Babu 2012-11-27 15:33:35 Renamng the file "MSG00001.bin" to "MSG00001.msg" for internal usage placed in src/bin/pgevent