pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: kiki@fesb.hr
To: Harald Armin Massa <haraldarminmassa@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: CPU load
Date: Mon, 29 Sep 2008 10:39:29 +0200 (CEST)
Message-ID: <50519.161.53.168.65.1222677569.squirrel@www.fesb.hr> (raw)
In-Reply-To: <7be3f35d0809290026o43e7879fu760d1ddbc360b177@mail.gmail.com>
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>
	<7be3f35d0809290026o43e7879fu760d1ddbc360b177@mail.gmail.com>

Hello Herald,

the queried table is used for communication between server application and
web user interface.
When application detects an event it writes it down in table.
The web client checks every 10 second if something new is written in the
table.
Usually nothing new is written but the client has to check it.
I don't fetch all rows, usually just the last one written.
The speed of the query is not a problem but the strange thing is the
processor load with postmaster when the query is executed.
I don’t now how to reduce processor load.
Should I change some other settings beside shared_buffers like work_mem?
Or maybe such processor load is OK?

Regards,
Maja

> Hello Maja,
>
>> 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)
>
> 700.000 of 1.000.000 rows is around 70% ... that are nearly all rows.
> As much as I read you, this table is not often modified. What reason
> is there for quering all that data again and again instead of keeping
> it in memory (should it be really needed) ?
>
>
> Harald
>
> --
> GHUM Harald Massa
> persuadere et programmare
> Harald Armin Massa
> Spielberger Straße 49
> 70435 Stuttgart
> 0173/9409607
> no fx, no carrier pigeon
> -
> EuroPython 2009 will take place in Birmingham - Stay tuned!
>
> --
> Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-performance
>





view thread (16+ messages)  latest in thread

Message-ID: <50519.161.53.168.65.1222677569.squirrel@www.fesb.hr>
Permalink:  ../50519.161.53.168.65.1222677569.squirrel@www.fesb.hr/
Also on:    postgresql.org/message-id/50519.161.53.168.65.1222677569.squirrel@www.fesb.hr

 · 

reply

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, haraldarminmassa@gmail.com
  Subject: Re: CPU load
  In-Reply-To: <50519.161.53.168.65.1222677569.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> <7be3f35d0809290026o43e7879fu760d1ddbc360b177@mail.gmail.com> <50519.161.53.168.65.1222677569.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