From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Mark Dilger <markdilger(at)yahoo(dot)com> |
Cc: | "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Performance patch for Win32 |
Date: | 2012-05-29 21:30:26 |
Message-ID: | 29471.1338327026@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Mark Dilger <markdilger(at)yahoo(dot)com> writes:
> 4) Other places in the PostgreSQL sources where directory
> iteration is needed should probably use a pattern if possible
> when running on Windows. Thus, it might make more
> sense to have a version of ReadDir that explicitly takes a
> pattern, and use that version of ReadDir elsewhere in the
> codebase.
Yeah, I think a separate argument passed to an AllocateDir variant
would be a less ugly way to deal with this. For example, in place
of your first #ifdef block just write
temp_dir = AllocateDirWithFilePattern(tmpdirname,
PG_TEMP_FILE_PREFIX "*");
What is not immediately obvious to me is whether we should try to make
the pattern argument do something useful on non-Windows platforms
(and thus allow removal of the ad-hoc pattern match code in the loops
where this is used); versus just treating it as a no-op on non-Windows.
If we did that, we'd have to consider that Windows gets to define what
the pattern language is and try to emulate that; which is likely to be
expensive enough to not be a win, not to mention that non-Windows
developers might not be terribly familiar with the finer points of the
pattern language.
I'm kind of inclined to consider that we should just treat the pattern
option as a Windows-specific wart and keep the ad-hoc matching code as
it is.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2012-05-29 21:35:18 | Re: pg_upgrade libraries check |
Previous Message | Bruce Momjian | 2012-05-29 21:17:17 | Re: pg_upgrade libraries check |