Re: CPU load

From: kiki(at)fesb(dot)hr
To: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: CPU load
Date: 2008-09-29 08:29:45
Message-ID: 50443.161.53.168.65.1222676985.squirrel@www.fesb.hr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Sorry, without LIMIT returns around 700000 rows.
Tried to index date column and time column but the performance is pretty
much the same.
Everything is OK, I just don’t understand way is this query burdening the
processor so much.

Regards,
Maja

> kiki wrote:
>> First I have increased shared_buffers from 2000 to 8000. Since the
>> postgresql is on Debian I had to increase SHMMAX kernel value.
>> Everything is working much faster now.
>
> Good to hear that the problem is gone.
>
>> There is still heavy load of postmaster process (up to 100%) for a
>> simple
>> query
>>
>> EXPLAIN ANALYSE SELECT * FROM system_alarm WHERE id_camera='3' AND
>> confirmed='false' AND dismissed='false' ORDER BY date DESC, time DESC
>> LIMIT 1;
>>
>> (the table is indexed by id_camera, has around 1 milion rows, and this
>> query returns around 700000 rows and is executed (EXPLAIN ANALYSE) in
>> around 4800 ms, and this table is queried a lot although not so often
>> queried modified)
>>
>> but I don't think that is strange behavior of the postgresql.
>> And it is exhibited all the time; the postgresql reset does not
>> influence
>> it at all.
>
> I'd expect a sequential scan for a query that returns 70% of the table.
>
> But I cannot believe that this query returns more than one row since
> it has a "LIMIT 1". Can you enlighten me?
>
> In the above query (with LIMIT 1), maybe an index on "date" could help.
>
> Yours,
> Laurenz Albe
>
>
> --
> Sent via pgsql-performance mailing list (pgsql-performance(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-performance
>

In response to

Responses

  • Re: CPU load at 2008-09-29 08:46:30 from hubert depesz lubaczewski
  • Re: CPU load at 2008-09-29 08:50:27 from Albe Laurenz

Browse pgsql-performance by date

  From Date Subject
Next Message kiki 2008-09-29 08:39:29 Re: CPU load
Previous Message Albe Laurenz 2008-09-29 07:39:09 Re: CPU load