Re: Query causing explosion of temp space with join involving partitioning - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Query causing explosion of temp space with join involving partitioning
Date
Msg-id 3578.1274978488@sss.pgh.pa.us
Whole thread Raw
In response to Re: Query causing explosion of temp space with join involving partitioning  (Krzysztof Nienartowicz <Krzysztof.Nienartowicz@unige.ch>)
Responses Re: Query causing explosion of temp space with join involving partitioning  (Krzysztof Nienartowicz <Krzysztof.Nienartowicz@unige.ch>)
List pgsql-bugs
Krzysztof Nienartowicz <Krzysztof.Nienartowicz@unige.ch> writes:
> Logs of the system running queries are not utterly clear, so chasing the
> parameters for the explosive query is not that simple (shared logs between
> multiple threads), but from what I see there is no difference between them
> and the plan looks like (without removal of irrelevant parameters this time,
> most of them are float8, but also bytea)
> [ nestloop with inner index scans over the inherited table ]

Well, that type of plan isn't going to consume much memory or disk
space.  What I suspect is happening is that sometimes, depending on the
specific parameter values called out in the query, the planner is
switching to another plan type that does consume lots of space (probably
via sort or hash temp files).  The most obvious guess is that that will
happen when the range limits on srcid get far enough apart to make a
nestloop not look cheap.  You could try experimenting with EXPLAIN and
different constant values to see what you get.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Cache lookup failure for index during pg_dump
Next
From: valgog
Date:
Subject: Re: BUG #5465: dblink TCP connection hangs blocking transaction from being terminated