From: kiki@fesb.hr
To: Albe Laurenz <laurenz.albe@wien.gv.at>
Cc: pgsql-performance@postgresql.org
Subject: Re: CPU load
Date: Mon, 29 Sep 2008 10:29:45 +0200 (CEST)
Message-ID: <50443.161.53.168.65.1222676985.squirrel@www.fesb.hr> (raw)
In-Reply-To: <D960CB61B694CF459DCFB4B0128514C2028AAD22@exadv11.host.magwien.gv.at>
References: <50724.193.198.80.76.1222370001.squirrel@www.fesb.hr>
<dcc563d10809251300i7e8dd8aej12d08a4082671bbf@mail.gmail.com>
<D960CB61B694CF459DCFB4B0128514C2028AA976@exadv11.host.magwien.gv.at>
<49663.161.53.168.65.1222428487.squirrel@www.fesb.hr>
<D960CB61B694CF459DCFB4B0128514C2028AABB1@exadv11.host.magwien.gv.at>
<a1ec7d000809260801q17238d58wa6e4731e3a1d795b@mail.gmail.com>
<49550.161.53.168.65.1222672642.squirrel@www.fesb.hr>
<D960CB61B694CF459DCFB4B0128514C2028AAD22@exadv11.host.magwien.gv.at>
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 dont 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@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-performance
>
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: kiki@fesb.hr, laurenz.albe@wien.gv.at
Subject: Re: CPU load
In-Reply-To: <50443.161.53.168.65.1222676985.squirrel@www.fesb.hr>
References: <50724.193.198.80.76.1222370001.squirrel@www.fesb.hr> <dcc563d10809251300i7e8dd8aej12d08a4082671bbf@mail.gmail.com> <D960CB61B694CF459DCFB4B0128514C2028AA976@exadv11.host.magwien.gv.at> <49663.161.53.168.65.1222428487.squirrel@www.fesb.hr> <D960CB61B694CF459DCFB4B0128514C2028AABB1@exadv11.host.magwien.gv.at> <a1ec7d000809260801q17238d58wa6e4731e3a1d795b@mail.gmail.com> <49550.161.53.168.65.1222672642.squirrel@www.fesb.hr> <D960CB61B694CF459DCFB4B0128514C2028AAD22@exadv11.host.magwien.gv.at> <50443.161.53.168.65.1222676985.squirrel@www.fesb.hr>
* 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