Re: keeping an index in memory

From: Rajarshi Guha <rguha(at)indiana(dot)edu>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: keeping an index in memory
Date: 2007-10-21 14:55:12
Message-ID: 25F16FB4-8D5A-41AF-8820-EA3E28BD55BA@indiana.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Oct 21, 2007, at 10:40 AM, Martijn van Oosterhout wrote:

> On Sun, Oct 21, 2007 at 07:36:00AM -0400, Bill Moran wrote:
>> What version of PG are you using and what is your shared_buffers
>> setting?
>>
>> With 8G of RAM, you should start with shared_buffers around 2 -
>> 3G, if
>> you're using a modern version of PG. With that much shared memory, a
>> large portion of that index should stay in RAM, as long as it's being
>> used often enough that PG doesn't swap it for other data.
>
> With that much memory, the index is likely to remain in memory no
> matter what size shared_memory he has. Anything in shared_memory is
> going to be in the system cache anyway. I wonder if there's something
> else we havn't been told, like how big the actual table is and whether
> there are any other large tables/indexes.

The table itself is about 10M rows corresponding to 14GB. The only
other index on this table is a btree index whose size is ~300MB. The
machine is not running anything else.

Now, it might just be the case that given the size of the index, I
cannot make bounding box queries (which will use the CUBE index) go
any faster. But I am surprised that that the other type of query
(using cube_distance which by definition must use a seq scan) is only
slightly longer. If nothing else, scanning through 14GB of data
should be 3 times slower than scanning through 3GB of data.

-------------------------------------------------------------------
Rajarshi Guha <rguha(at)indiana(dot)edu>
GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
-------------------------------------------------------------------
All laws are simulations of reality.
-- John C. Lilly

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Browning 2007-10-21 15:36:58 Photos from the PostgreSQL Conference Fall 2007
Previous Message Rajarshi Guha 2007-10-21 14:44:03 Re: keeping an index in memory