Re: count with high allocation

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: paulo matadr <saddoness(at)yahoo(dot)com(dot)br>
Cc: GENERAL <pgsql-general(at)postgresql(dot)org>
Subject: Re: count with high allocation
Date: 2010-04-07 14:26:13
Message-ID: j2v162867791004070726g8735509s1af1eb0a31d21af2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello

2010/4/7 paulo matadr <saddoness(at)yahoo(dot)com(dot)br>:
> Hi all,
> Monitoring "top" in database server  , i could  noticed an query with
> reserved  8GB on physical memory.
>
> select count(field) from big_table  1 inner join big_table2...
>
> There is the possibility of using another function with less memory
> allocation?
> Is there a way to limit the memory usage of the count?

probably you have unactualised statistic. What is result of EXPLAIN
ANALYZE select count(... ?

I think, so planner uses hash arrays

try to

set enable_hashagg to off;
and again SELECT ...

Regards
Pavel Stehule

>
>
>
> Paul
>
>
> ________________________________
> Veja quais são os assuntos do momento no Yahoo! + Buscados: Top 10 -
> Celebridades - Música - Esportes

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2010-04-07 14:27:35 Re: count with high allocation
Previous Message paulo matadr 2010-04-07 14:11:41 count with high allocation