Fehler: Speicher aufgebraucht

Hallo Leute,

ich suche seit Tagen verzweifelt nach einer Lösung meines Problems. Vielleicht könnt ihr mir helfen…

Ich arbeite seit kurzem mit rekusiven SQL Statements, was meines Wissens nach auch erst seit 8.4 möglich ist. Beim ausführen eines solchen Statements bekomme ich folgende Fehlermeldung:

+++++++++++++++++++++++++++++++++++

FEHLER: Speicher aufgebraucht
DETAIL: Fehler bei Anfrage mit Größe 1024.

********** Error **********

FEHLER: Speicher aufgebraucht
SQL state: 53200
Detail: Fehler bei Anfrage mit Größe 1024.

++++++++++++++++++++++++++++++++++++

Das Logfile sieht folgendermaßen aus:

++++++++++++++++++++++++++++++++++++
TopMemoryContext: 50992 total in 6 blocks; 5656 free (8 chunks); 45336 used
TopTransactionContext: 8192 total in 1 blocks; 7696 free (0 chunks); 496 used
Type information cache: 8192 total in 1 blocks; 1800 free (0 chunks); 6392 used
Operator class cache: 8192 total in 1 blocks; 3848 free (0 chunks); 4344 used
Operator lookup cache: 24576 total in 2 blocks; 14072 free (6 chunks); 10504 used
MessageContext: 1048576 total in 8 blocks; 375696 free (5 chunks); 672880 used
JoinRelHashTable: 8192 total in 1 blocks; 4864 free (0 chunks); 3328 used
smgr relation table: 8192 total in 1 blocks; 760 free (0 chunks); 7432 used
TransactionAbortContext: 32768 total in 1 blocks; 32752 free (0 chunks); 16 used
Portal hash: 8192 total in 1 blocks; 3912 free (0 chunks); 4280 used
PortalMemory: 8192 total in 1 blocks; 8040 free (0 chunks); 152 used
PortalHeapMemory: 1024 total in 1 blocks; 936 free (0 chunks); 88 used
ExecutorState: 155904 total in 8 blocks; 17104 free (0 chunks); 138800 used
ExprContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used
ExprContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used
ExprContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used
ExprContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used
ExprContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used
ExprContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used
ExprContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used
ExprContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used
.
.
.
ExprContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used
ExprContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used
RecursiveUnion hash table: 8192 total in 1 blocks; 8104 free (0 chunks); 88 used
TupleHashTable: 1974460440 total in 246 blocks; 120128 free (962 chunks); 1974340312 used
RecursiveUnion: 0 total in 0 blocks; 0 free (0 chunks); 0 used
Relcache by OID: 8192 total in 1 blocks; 2856 free (0 chunks); 5336 used
CacheMemoryContext: 667696 total in 20 blocks; 128008 free (0 chunks); 539688 used
box_pkey: 1024 total in 1 blocks; 344 free (0 chunks); 680 used
rebeln_pkey: 1024 total in 1 blocks; 344 free (0 chunks); 680 used
.
.
.
pg_attribute_relid_attnam_index: 1024 total in 1 blocks; 280 free (0 chunks); 744 used
pg_conversion_oid_index: 1024 total in 1 blocks; 344 free (0 chunks); 680 used
pg_user_mapping_user_server_index: 1024 total in 1 blocks; 280 free (0 chunks); 744 used
pg_conversion_name_nsp_index: 1024 total in 1 blocks; 280 free (0 chunks); 744 used
MdSmgr: 8192 total in 1 blocks; 7504 free (0 chunks); 688 used
LOCALLOCK hash: 8192 total in 1 blocks; 3912 free (0 chunks); 4280 used
Timezones: 78520 total in 2 blocks; 5968 free (0 chunks); 72552 used
ErrorContext: 8192 total in 1 blocks; 8176 free (0 chunks); 16 used
2010-07-27 15:36:04 CEST insyde1 postgres FEHLER: Speicher aufgebraucht
2010-07-27 15:36:04 CEST insyde1 postgres DETAIL: Fehler bei Anfrage mit Größe 1024.
+++++++++++++++++++++++++++++++++

hat jemand eine Idee? Danke…

Hrm. Bist Du sicher, daß die Rekursion richtig abbricht, also beendet wird?

Andreas

ja…es hat auch schon funktioniert

als dann mehr datensätze in der db waren, hat es nicht mehr funktioniert…

im .conf file habe ich auch schon alle möglichen parameter hochgeschraubt

OS: Suse 11.2
DB: 8.4

Welche Werte - und auf welche Einstellungen?
Wieviele Datensätze werden da durch deine Anfrage durchgeschoben?
Wie sieht der Anfrageplan dafür aus?

Welche Werte - und auf welche Einstellungen?

checkpoint_segments = 3
checkpoint_completion_target = 0.5
wal_buffers = 128kB
shared_buffers = 128MB
temp_buffers = 128MB
work_mem = 32MB
maintenance_work_mem = 64MB
max_connections = 50
effective_cache_size = 32MB
max_locks_per_transaction = 100

Wieviele Datensätze werden da durch deine Anfrage durchgeschoben?

8 IDs…integer werte…also überhaupt keine großen Datenmengen

Wie sieht der Anfrageplan dafür aus?

EXPLAIN WITH RECURSIVE rekursion (we…

liefert leider keinen output außer der Fehlermeldung

LG

Also die Konfiguration ist nicht wirklich angepasst … die ist sogar erschreckend.

Wieviel Hauptspeicher hat die Maschine?

is ne alte Maschine:

cat /proc/meminfo

MemTotal: 1550996 kB
MemFree: 1493336 kB
Buffers: 2824 kB
Cached: 23996 kB
SwapCached: 2716 kB
Active: 15636 kB
Inactive: 18312 kB
Active(anon): 8532 kB
Inactive(anon): 3148 kB
Active(file): 7104 kB
Inactive(file): 15164 kB

1,5 GB, richtig?

Mach mal aus deinem work_mem ungefähr 2 MB oder 4 MB, erhöhe dafür das shared_buffers ein Stück.
Oh, und kriegst du es ev. hin, das System auf englisch umzustellen? Deutsche Fehlermeldungen sind irgendwie nicht aussagekräftig …

hab ich versucht…error bleibt aber gleich…

englisch umstellen hab ich versucht…funkt aber nicht…

hast evtl. noch eine idee?

Zeig uns die Tabelle und die Abfrage. Hänge am besten die Befehle zum erstellen und befüllen der Tabelle an und die Abfrage.

Andreas