Hi
I have been using Postgresql for about 3 weeks now with no problem.
The main task I use PG for is to import data from a file to a
temporary
table, which triggers a function that inserts (unique) data to the
"main-table" (called metar)
Today suddenly everything went *very* slow. Restart of
server/postgresql and
running vacuum did not help. I have now approx. 800 000 rows in the
"main-table", disk usagem approx. 1GB.
The function triggered when inserting data to temporary table looks
like:
CREATE FUNCTION test_inserted_data() RETURNS OPAQUE AS '
DECLARE
curr_val TEXT;
BEGIN
SELECT UNIK_ID INTO curr_val FROM metar WHERE unik_id = new.UNIK_ID;
IF NOT FOUND THEN
insert into metar(
...... (text excluded)
ELSE
update metar set
....... (text excluded)
WHERE UNIK_ID = new.UNIK_ID;
END IF;
RETURN old;
END;
...where unik_id is an index
Have I somehow ran my head into a limitation in my current setup of
Postgresql? My postgresql.conf is "empty", that is: everything is
commented out as default.
Hope someone has ideas about this!
best regards
Svein Are
Norway