Re: Parallell hashjoin sometimes ignores temp_tablespaces

2020-07-05 Thread Magnus Hagander
On Fri, Jul 3, 2020 at 11:02 PM Tom Lane wrote: > Magnus Hagander writes: > > On Fri, Jul 3, 2020 at 7:06 PM Tom Lane wrote: > >> Shouldn't that be inserting MyDatabaseTableSpace? I see no other places > >> anywhere that are forcing temp stuff into pg_default like this. > > > Yeah, looking at

Re: Parallell hashjoin sometimes ignores temp_tablespaces

2020-07-03 Thread Tom Lane
Magnus Hagander writes: > On Fri, Jul 3, 2020 at 7:06 PM Tom Lane wrote: >> Shouldn't that be inserting MyDatabaseTableSpace? I see no other places >> anywhere that are forcing temp stuff into pg_default like this. > Yeah, looking at it again, I think it should. I can't see any reason why it >

Re: Parallell hashjoin sometimes ignores temp_tablespaces

2020-07-03 Thread Magnus Hagander
On Fri, Jul 3, 2020 at 7:06 PM Tom Lane wrote: > Magnus Hagander writes: > > On Fri, Jul 3, 2020 at 6:12 PM Tom Lane wrote: > >> The lack of documentation seems to be my fault, so I'm willing to pick > >> this up unless somebody else wants it. > > > If the comments I included in that patch are

Re: Parallell hashjoin sometimes ignores temp_tablespaces

2020-07-03 Thread Tom Lane
Magnus Hagander writes: > On Fri, Jul 3, 2020 at 6:12 PM Tom Lane wrote: >> The lack of documentation seems to be my fault, so I'm willing to pick >> this up unless somebody else wants it. > If the comments I included in that patch are enough, I can just commit > those along with it. Otherwise,

Re: Parallell hashjoin sometimes ignores temp_tablespaces

2020-07-03 Thread Magnus Hagander
On Fri, Jul 3, 2020 at 6:12 PM Tom Lane wrote: > Magnus Hagander writes: > > A quick look -- to do things right, we will need to know the database > > default tablespace in this case right? Which I guess isn't there because > > the shared fileset isn't tied to a database. But perhaps it's as eas

Re: Parallell hashjoin sometimes ignores temp_tablespaces

2020-07-03 Thread Tom Lane
Magnus Hagander writes: > A quick look -- to do things right, we will need to know the database > default tablespace in this case right? Which I guess isn't there because > the shared fileset isn't tied to a database. But perhaps it's as easy as > something like the attached, just overwriting the

Re: Parallell hashjoin sometimes ignores temp_tablespaces

2020-07-03 Thread Magnus Hagander
On Fri, Jul 3, 2020 at 4:16 PM Tom Lane wrote: > Magnus Hagander writes: > > Thanks. pushed! > > Sorry for not having paid more attention earlier, but this patch is > quite broken. If it weren't misguided it'd still be wrong, because > this isn't the only spot in PrepareTempTablespaces that ins

Re: Parallell hashjoin sometimes ignores temp_tablespaces

2020-07-03 Thread Tom Lane
Magnus Hagander writes: > Thanks. pushed! Sorry for not having paid more attention earlier, but this patch is quite broken. If it weren't misguided it'd still be wrong, because this isn't the only spot in PrepareTempTablespaces that inserts InvalidOid into the output list. But, in fact, it's in

Re: Parallell hashjoin sometimes ignores temp_tablespaces

2020-07-03 Thread Magnus Hagander
On Mon, Jun 29, 2020 at 10:26 PM Daniel Gustafsson wrote: > > On 29 Jun 2020, at 17:02, Magnus Hagander wrote: > > > I think the fix is the attached one (tested on version 11 which is what > $customer is using). To me it looks like this may have been a copy/paste > error all the way back in 98e

Re: Parallell hashjoin sometimes ignores temp_tablespaces

2020-06-29 Thread Daniel Gustafsson
> On 29 Jun 2020, at 17:02, Magnus Hagander wrote: > I think the fix is the attached one (tested on version 11 which is what > $customer is using). To me it looks like this may have been a copy/paste > error all the way back in 98e8b480532 which added default_tablespace back in > 2004. (And i

Parallell hashjoin sometimes ignores temp_tablespaces

2020-06-29 Thread Magnus Hagander
If a database (a) has a default tablespace set, Reproduction: CREATE TABLESPACE t LOCATION '/tmp/t'; CREATE DATABASE dumb TABLESPACE t; \c dumb SET temp_tablespaces=t; At this point if you run a query with a parallel hash join in it, the tempfiles go in base/pgsql_tmp instead of the temporary ta