Re: postgresql is slow with larger table even it is in RAM - Mailing list pgsql-performance

From Bill Moran
Subject Re: postgresql is slow with larger table even it is in RAM
Date
Msg-id 20080325091046.b5d50a35.wmoran@collaborativefusion.com
Whole thread Raw
In response to postgresql is slow with larger table even it is in RAM  ("sathiya psql" <sathiya.psql@gmail.com>)
Responses Re: postgresql is slow with larger table even it is in RAM
List pgsql-performance
In response to "sathiya psql" <sathiya.psql@gmail.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@collaborativefusion.com
Phone: 412-422-3463x4023

pgsql-performance by date:

Previous
From: Craig Ringer
Date:
Subject: Re: what is the maximum number of rows in a table in postgresql 8.1
Next
From: Ivan Voras
Date:
Subject: Re: what is the maximum number of rows in a table in postgresql 8.1