Skip site navigation (1) Skip section navigation (2)

Re: postgresql is slow with larger table even it is in RAM

From: Bill Moran <wmoran(at)collaborativefusion(dot)com>
To: "sathiya psql" <sathiya(dot)psql(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: postgresql is slow with larger table even it is in RAM
Date: 2008-03-25 13:10:46
Message-ID: 20080325091046.b5d50a35.wmoran@collaborativefusion.com (view raw or flat)
Thread:
Lists: pgsql-performance
In response to "sathiya psql" <sathiya(dot)psql(at)gmail(dot)com>:

> Dear Friends,
>      I have a table with 32 lakh record in it. Table size is nearly 700 MB,
> and my machine had a 1 GB + 256 MB RAM, i had created the table space in
> RAM, and then created this table in this RAM.
> 
>     So now everything is in RAM, if i do a count(*) on this table it returns
> 327600 in 3 seconds, why it is taking 3 seconds ????? because am sure that
> no Disk I/O is happening. ( using vmstat i had confirmed, no disk I/O is
> happening, swap is also not used )
> 
> Any Idea on this ???

Yes.  It takes your hardware about 3 seconds to read through 700M of ram.

Keep in mind that you're not just reading RAM.  You're pushing system
requests through the VFS layer of your operating system, which is treating
the RAM like a disk (with cylinder groups and inodes and blocks, etc) so
you have all that processing overhead as well.  What filesystem did you
format the RAM disk with?

Why are you doing this?  If you have enough RAM to store the table, why
not just allocate it to shared buffers?

-- 
Bill Moran
Collaborative Fusion Inc.
http://people.collaborativefusion.com/~wmoran/

wmoran(at)collaborativefusion(dot)com
Phone: 412-422-3463x4023

In response to

Responses

pgsql-performance by date

Next:From: Ivan VorasDate: 2008-03-25 13:16:43
Subject: Re: what is the maximum number of rows in a table in postgresql 8.1
Previous:From: Craig RingerDate: 2008-03-25 13:09:34
Subject: Re: what is the maximum number of rows in a table in postgresql 8.1

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group