Skip site navigation (1) Skip section navigation (2)

Re: review: pgbench - aggregation of info written into log

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: andrew(at)dunslane(dot)net
Cc: tv(at)fuzzy(dot)cz, pgsql-hackers(at)postgresql(dot)org
Subject: Re: review: pgbench - aggregation of info written into log
Date: 2013-01-16 23:48:01
Message-ID: 20130117.084801.884655668614501591.t-ishii@sraoss.co.jp (view raw or flat)
Thread:
Lists: pgsql-hackers
>> I'm looking into this as a committer.  It seems that this is the
>> newest patch and the reviewer(Pavel) stated that it is ready for
>> commit. However, I noticed that this patch adds a Linux/UNIX only
>> feature(not available on Windows). So I would like to ask cores if
>> this is ok or not.
> 
> I haven't been following the thread, but if the complaint is that
> Windows doesn't have accurate high-resolution timers, which is what it
> kinda looks like from the rest of your message, then it's not
> true. Every version since Windows2000 has had
> QueryPerformanceCounter()/QueryPerformanceFrequency(). And we use it:
> see src/include/portability/instr_time.h

In my understanding the problem is not related to resolution.

> If that's not the problem, then can someone please point me at the
> message that sets the problem out clearly, or else just recap it?

It seems instr_time.h on Windows simply does not provide current
timestamp. From pgbench.c:

		/*
		 * if transaction finished, record the time it took in the log
		 */
		if (logfile && commands[st->state + 1] == NULL)
		{
			instr_time	now;
			instr_time	diff;
			double		usec;

			INSTR_TIME_SET_CURRENT(now);
			diff = now;
			INSTR_TIME_SUBTRACT(diff, st->txn_begin);
			usec = (double) INSTR_TIME_GET_MICROSEC(diff);

#ifndef WIN32
			/* This is more than we really ought to know about instr_time */
			fprintf(logfile, "%d %d %.0f %d %ld %ld\n",
					st->id, st->cnt, usec, st->use_file,
					(long) now.tv_sec, (long) now.tv_usec);
#else
			/* On Windows, instr_time doesn't provide a timestamp anyway */
			fprintf(logfile, "%d %d %.0f %d 0 0\n",
					st->id, st->cnt, usec, st->use_file);
#endif
		}
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp


In response to

Responses

pgsql-hackers by date

Next:From: Kohei KaiGaiDate: 2013-01-17 00:13:22
Subject: Re: ALTER command reworks
Previous:From: Robert HaasDate: 2013-01-16 23:42:33
Subject: Re: Event Triggers: adding information

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group