Re: another query optimization question

From: David Teran <david(dot)teran(at)cluster9(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>, PgSQL Performance ML <pgsql-performance(at)postgresql(dot)org>
Subject: Re: another query optimization question
Date: 2004-01-31 10:28:35
Message-ID: 39D3D2E6-53D8-11D8-9392-000A95A6F0DC@cluster9.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi Tim,

you are right:

> Interesting. I have recollected where we saw this before:
> http://archives.postgresql.org/pgsql-hackers/2003-11/msg01528.php
> Apparently gettimeofday() has a glitch on some BSD releases. OS X is
> a BSD derivative and it's not so surprising if it has it too.
>
> May I suggest that you try the test program given here:
> http://archives.postgresql.org/pgsql-hackers/2003-11/msg01546.php
> and file a bug report with Apple if it shows any out-of-order results?
>
> I am fairly certain that I tried that test program when I devised it
> on my own OS X machine, and couldn't get a failure. Maybe it depends
> on your hardware (hm, could dual CPUs be the key factor)?

p:~ david$ ./a.out
bogus tv_usec: 1075544305 -615731632, prev 1075544304 349672
out of order tv_sec: 1075544304 349759, prev 1075544305 -615731632
out of order tv_usec: 1075544305 339904, prev 1075544305 339905
bogus tv_usec: 1075544307 -615731811, prev 1075544306 349493
out of order tv_sec: 1075544306 349498, prev 1075544307 -615731811
out of order tv_usec: 1075544307 339442, prev 1075544307 339443
out of order tv_usec: 1075544308 339351, prev 1075544308 339352

This is a part of the output. Whats -very- interesting:

Apple provides a little tool that can enable / disable the l2 cache ...
one CPU of a dual CPU system on the fly. When i start the testapp with
two CPU's enabled i get this output here, when i turn off one CPU while
the app is still running the messages disappear as long as one CPU is
turned off. Reactivating the CPU again produces new error messages. I
checked the app on a single G4, no errors and i checked the app on a
dual G4, -not- G5 and also no error messages.

Do you remember where one can find a patch? Maybe its something one can
fix because parts of the OS from Apple are 'open source'.

Do you know if this bug makes a system unusable with PostgresSQL?

Regards David

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2004-01-31 15:45:56 Re: another query optimization question
Previous Message Kari Lavikka 2004-01-31 08:52:40 Re: Unique index and estimated rows.