Re: Use CLOCK_MONOTONIC_COARSE for instr_time when available
От | Tom Lane |
---|---|
Тема | Re: Use CLOCK_MONOTONIC_COARSE for instr_time when available |
Дата | |
Msg-id | 1288620.1752699341@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Use CLOCK_MONOTONIC_COARSE for instr_time when available (Jianghua Yang <yjhjstz@gmail.com>) |
Ответы |
Re: Use CLOCK_MONOTONIC_COARSE for instr_time when available
|
Список | pgsql-hackers |
Jianghua Yang <yjhjstz@gmail.com> writes: > By using CLOCK_MONOTONIC_COARSE, which has lower overhead compared to > CLOCK_MONOTONIC, the patch improves the efficiency of timing > collection in EXPLAIN > ANALYZE. While it may slightly reduce precision, the resulting measurements > more closely reflect actual elapsed time observed by users, especially in > performance-sensitive environments. This makes EXPLAIN ANALYZE outputs more > reliable and helpful for developers diagnosing query performance > bottlenecks. Well, this is exactly the thing that everybody is worried about. You're asserting on the basis of precisely zero evidence that this will be an improvement; most of the rest of us expect that it will destroy the reliability of the measurements. "It's faster" is totally insufficient as a reason to accept this change. (As a wise man once said, "I can make my program arbitrarily fast if it doesn't have to give the right answer.") If you want to have any chance at all that this gets committed, you need to provide some evidence backing your claim that the results are still sufficiently reliable. The single test case that you presented isn't impressive. For one thing, it shows nontrivial change of the amount of time spent in the seqscan node vs. overall (62% vs 77%). Which ratio is more reflective of reality? How stable are the numbers across multiple runs? What will happen on other platforms besides your own machine? BTW, I'm also unimpressed by the changes to limit this to EXPLAIN ANALYZE. There's no reason to think that our other uses of instr_time.h are more sensitive to accuracy concerns than EXPLAIN ANALYZE is; if anything they are less so, since we don't accumulate a lot of very-tiny deltas anywhere else. So if this is good enough for EXPLAIN ANALYZE it should be fine for everything. regards, tom lane
В списке pgsql-hackers по дате отправления: