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

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

From: "sathiya psql" <sathiya(dot)psql(at)gmail(dot)com>
To: "Uwe C(dot) Schroeder" <uwe(at)oss4u(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: postgresql is slow with larger table even it is in RAM
Date: 2008-03-25 08:50:30
Message-ID: f966c2ee0803250150p3b3cf68bn32fd044ecf783624@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-admin
>
> I can't really say anything about your RAM issue, but count(*) is always a
> bad
> idea if it can be avoided. Assuming you have a primary key on the table,
> do a
> count(pk). In my experience that alone cuts down up to 30% of execution
> time.
>
> i want exact count so am doing this...

But as you are saying it is not doing so,
at first without primary key i had a column "id", it took the same 3 seconds
to show the count, after reading some tips i created primary key on that
"id", and i did select count(id) from table, and now also it is taking the
same 3 seconds.

In response to

Responses

pgsql-admin by date

Next:From: sathiya psqlDate: 2008-03-25 09:27:21
Subject: Re: postgresql is slow with larger table even it is in RAM
Previous:From: sathiya psqlDate: 2008-03-25 08:48:36
Subject: Re: postgresql is slow with larger table even it is in RAM

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