Re: Several queries consume 100 % processor

From: Richard Huxton <dev(at)archonet(dot)com>
To: "J(dot) ORIOL" <famach(at)yahoo(dot)com>
Cc: Martijn <kleptog(at)svana(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: Several queries consume 100 % processor
Date: 2007-05-23 14:05:26
Message-ID: 46544A26.6070700@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

J. ORIOL wrote:

>
> I'm filling a 40 x 10 matrix of data (A string grid), that's 400
> cells being calculated aproximately with 6 to 8 queries each one of
> them. That's 4800 queries to fill the matrix. In the server, this
> task delays 8 secs. but in the client are 40 secs.

What takes 40 seconds? If you're just running updates then the client
should receive acknowledgement.

> The server slows down all its processes, sorry, does'nt "stop" tasks,
> but in the practice, its the same, I think.
>
> Certainly, I want to know if I have serious design errors or if I
> have reached my HW limits; my hope was implementing functions in
> plpgsql, but you guys said this will not improve the process time as
> well.

You'll need to tell us something about your design. See my first reply
for what people will need.

As to whether your hardware is a limit - nobody can say without knowing
what you're doing with it.

Four obvious things leap out though:
1. Why does it take 6-8 queries to calculate one value?
2. What makes it necessary to calculate one cell at a time rather than
all at once?
3. Are you vacuuming enough, and how have you established this?
4. Why are you doing this in a database at all? For 4800 values I'd just
calculate them all in my application and then store the lot in one go.

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-general by date

  From Date Subject
Next Message PFC 2007-05-23 14:10:38 Re: Integrity on large sites
Previous Message J. ORIOL 2007-05-23 13:53:43 Re: Several queries consume 100 % processor