Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2008-03-25 09:51, sathiya psql wrote:

> 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 ?????

PostgreSQL needs to scan the whole table. And 700MB is a lot of data
even when in RAM. Check this:

$ dd if=/dev/zero bs=1M count=700 | cat > /dev/null
734003200 bytes (734 MB) copied, 1.38732 s, 529 MB/s

This command will just copy 700MB of zeros around in RAM, and it takes
over 1s to do it on my Pentium D 3,4GHz. PostgreSQL would need to do
much more with this data.

Maybe you just got bitten by count(*) gotcha:
http://sql-info.de/en/postgresql/postgres-gotchas.html#1_7
Maybe you'll get by with an estimate.

Regards
Tometzky
-- 
...although Eating Honey was a very good thing to do, there was a
moment just before you began to eat it which was better than when you
were...
                                                      Winnie the Pooh


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux