Thread: Re: [pgsql-hackers-win32] explain analyze timings

Re: [pgsql-hackers-win32] explain analyze timings

From
"Magnus Hagander"
Date:
>> Here's a patch that does just this.
>
>This seems about the ugliest and most intrusive way you could have
>done it :-(.  A judicious typedef and macro or two could eliminate
>most of the #ifdefs and code duplication, thereby preserving
>readability...

Well, I certainly can't argue with that, now that you mention it ;-)
Here is a second attempt, hope it's closer to what you expected.

I still left two #ifdefs in there, for the addition and subtraction of
timeval:s specifically. They could be made functions/macros too, just
not sure if it's worth it.

Tested on win32 and linux (now that it changes non-win32 specific code
as well).

//Magnus

Attachment

Re: [pgsql-hackers-win32] explain analyze timings

From
Tom Lane
Date:
"Magnus Hagander" <mha@sollentuna.net> writes:
> Here is a second attempt, hope it's closer to what you expected.

Better --- patch applied with some minor editorialization.

> I still left two #ifdefs in there, for the addition and subtraction of
> timeval:s specifically. They could be made functions/macros too, just
> not sure if it's worth it.

Probably not.  What bothers me more is the unconditional use of a
static inline function; but IIRC we are only supporting gcc-based builds
on Windows, so that probably isn't worth fixing either.

            regards, tom lane