Postgres function use makes machine crash.

From: Stef <svb(at)ucs(dot)co(dot)za>
To: pgsql-performance(at)postgresql(dot)org
Subject: Postgres function use makes machine crash.
Date: 2004-06-07 11:34:15
Message-ID: 20040607133415.09a2ce2f@svb.ucs.co.za
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi all,

I've been dealing with a problem for the past two days
where a certain sql statement works 2 out of 5 times, and
the other 3 times, it causes the machine (quad Xeon 2.8GHz
+ 792543232 bytes mem, linux kernel 2.4.26-custom, pg ver 7.3.4)
to slow down, and finally grind to a halt. It looks like postgres
gets itself into an insane loop, because no matter how much
shared memory I give it, it uses it all, and then
the kernel starts swapping.

I'm pretty sure it's not the kernel, because I've tried four different
2.4.2* stable kernels, and the same happens.

I've attached the query, and the functions used inside the query,
as well as the table structure and an explain. (I haven't been
able to get explain analyze)

It seems that when I replace the functions used in the query,
with the actual values returned by them (one date in each case),
the query runs in 10 seconds.

I did vacuum analyze, and reindex seemed to work at one
stage, but now it doesn't anymore.

Is there some limitation in using functions that I do not know
about, or is it a bug?

(It seems to be hanging on the max_fpp('''')
function call from inside the fpp_max_ms() function.)

Please help.

Kind Regards
Stefan

Attachment Content-Type Size
query.sql application/octet-stream 1.3 KB
explain.txt text/plain 2.4 KB
functions.sql application/octet-stream 546 bytes
structures.txt text/plain 2.7 KB

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2004-06-07 13:51:56 Re: Relation of cpu_*_costs?
Previous Message Kris Jurka 2004-06-07 09:26:38 Re: Using a COPY...FROM through JDBC?