Re: Is there a way to run tables in RAM?

From: Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Is there a way to run tables in RAM?
Date: 2006-07-13 22:16:27
Message-ID: 44B6C63B.7090503@cox.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Roy Souther wrote:
> I would like to know if there is anyway to move a section of some tables
> into RAM to work on them.
>
> I have large table, about 700MB or so and growing. I also have a bizarre
> collection of queries that run hundreds of queries on a small section of
> this table. These queries only look at about 100 or so records at a time
> and they run hundreds of queries on the data looking for patterns. This
> causes the program to run very slowly because of hard drive access time.
> Some times it needs to write changes back to the records it is working
> with.
>
> Is there anyway that I can move a few hundred records of the table into
> RAM and work on it there, it would be much faster.
>
> Is there anyway to create a temporary table that will only exist in RAM
> and not be written to the hard drive? Or do temporary tables already do
> that?
>
> If I can use a temporary table this way is there any simple way to merge
> the changes back into the original table?

What if you COPY OUT, sort(1) by the most common fields in the WHERE
clauses, and COPY IN the data?

That way, you get locality of data, and so the desired data is more
likely to be in the OS block cache?

- --
Ron Johnson, Jr.
Jefferson LA USA

Is "common sense" really valid?
For example, it is "common sense" to white-power racists that
whites are superior to blacks, and that those with brown skins
are mud people.
However, that "common sense" is obviously wrong.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEtsY7S9HxQb37XmcRAtXEAKCQKW6fxRKPlSrnsVhmcsvdLCRU+wCcCKLK
FTlvERCCH/ylgVbI2EwujBc=
=KRzE
-----END PGP SIGNATURE-----

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Antimon 2006-07-13 23:35:20 Timestamp vs timestamptz
Previous Message Karen Hill 2006-07-13 21:32:42 Re: Is there a way to run tables in RAM?