Re: [pgsql-hackers-win32] 300 seconds in less than 1 second with pg_autovacuum
"Dave Page" <[email protected]>
| Newsgroups | gmane.comp.db.postgresql.devel.patches,gmane.comp.db.postgresql.devel.win32 |
|---|---|
| Message-ID | <E7F85A1B5FF8D44C8A1AF6885BC9A0E45285AA@ratbert.vale-housing.co.uk> |
> -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf > Of Dave Page > Sent: 21 January 2005 13:20 > To: Harald Massa; [email protected] > Subject: Re: [pgsql-hackers-win32] 300 seconds in less than 1 > second with pg_autovacuum > > > > > -----Original Message----- > > From: [email protected] > > [mailto:[email protected]] On Behalf > > Of Harald Massa > > Sent: 21 January 2005 12:55 > > To: [email protected] > > Subject: [pgsql-hackers-win32] 300 seconds in less than 1 > > second with pg_autovacuum > > > > What is going wrong? I did not fiddle with the > > "Sleep-Period", just left it > > on default. > > > > Hmm: > > Windows: > > VOID Sleep(DWORD dwMilliseconds); > > Unix: > > unsigned int sleep(unsigned int seconds); > > D'oh! > > Patch coming up.... Patch attached... Harald, do you want another exe to try? Regards, Dave ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives? http://archives.postgresql.org
pg_autovacuum.c.diff
(application/octet-stream, 795 B)
cvs diff -u pg_autovacuum.c (in directory C:\Documents and Settings\dpage\My Documents\CVS\pgsql\contrib\pg_autovacuum) Index: pg_autovacuum.c =================================================================== RCS file: /projects/cvsroot/pgsql/contrib/pg_autovacuum/pg_autovacuum.c,v retrieving revision 1.27 diff -u -r1.27 pg_autovacuum.c --- pg_autovacuum.c 2 Dec 2004 22:48:10 -0000 1.27 +++ pg_autovacuum.c 21 Jan 2005 13:22:46 -0000 @@ -1699,7 +1703,11 @@ fflush(LOGOUTPUT); } - sleep(sleep_secs); /* Larger Pause between outer loops */ +#ifndef WIN32 + sleep(sleep_secs); /* Larger Pause between outer loops */ +#else + sleep(sleep_secs * 1000); /* Larger Pause between outer loops */ +#endif gettimeofday(&then, 0); /* Reset time counter */