pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Luke Lonergan <llonergan@greenplum.com>
To: sathiya psql <sathiya.psql@gmail.com>
To: pgsql-performance@postgresql.org
Subject: Re: postgresql is slow with larger table even it is in RAM
Date: Tue, 25 Mar 2008 07:46:02 -0700
Message-ID: <C40E5E3A.583A9%llonergan@greenplum.com> (raw)
In-Reply-To: <f966c2ee0803250135h57ba1d5bs41f77616ae7186dc@mail.gmail.com>

Hello Sathiya,

1st:  you should not use a ramdisk for this, it will slow things down as
compared to simply having the table on disk.  Scanning it the first time
when on disk will load it into the OS IO cache, after which you will get
memory speed.

2nd: you should expect the ³SELECT COUNT(*)² to run at a maximum of about
350 ­ 600 MB/s (depending on PG version and CPU speed).  It is CPU speed
limited to that rate of counting rows no matter how fast your IO is.

So, for your 700 MB table, you should expect a COUNT(*) to run in about 1-2
seconds best case.  This will approximate the speed at which other queries
can run against the table.

- Luke


On 3/25/08 1:35 AM, "sathiya psql" <sathiya.psql@gmail.com> wrote:

> 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 ???
> 
> I searched a lot in newsgroups ... can't find relevant things.... ( because
> everywhere they are speaking about disk access speed, here i don't want to
> worry about disk access )
> 
> If required i will give more information on this.
> 
> 
> 

view thread (13+ messages)  latest in thread

Message-ID: <C40E5E3A.583A9%llonergan@greenplum.com>
Permalink:  ../C40E5E3A.583A9%25llonergan@greenplum.com/
Also on:    postgresql.org/message-id/C40E5E3A.583A9%llonergan@greenplum.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: llonergan@greenplum.com, sathiya.psql@gmail.com
  Subject: Re: postgresql is slow with larger table even it is in RAM
  In-Reply-To: <C40E5E3A.583A9%llonergan@greenplum.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox