Re: Sampling-based timing for EXPLAIN ANALYZE

2023-07-03 Thread Daniel Gustafsson
This thread has been stale since January with no movement at all during the March CF, and according to the CFBot it stopped building at all ~ 14 weeks ago. I'm marking this returned with feedback, it can be resubmitted for a future CF if someone decides to pick it up. -- Daniel Gustafsson

Re: Sampling-based timing for EXPLAIN ANALYZE

2023-03-14 Thread Greg Stark
On Tue, 17 Jan 2023 at 14:52, Tomas Vondra wrote: > > On 1/17/23 19:46, Andres Freund wrote: > > > I think a "hybrid" explain mode might be worth thinking about. Use the > > "current" sampling method for the first execution of a node, and for the > > first > > few milliseconds of a query (or

Re: Sampling-based timing for EXPLAIN ANALYZE

2023-01-17 Thread Tomas Vondra
On 1/17/23 19:46, Andres Freund wrote: > Hi, > > On 2023-01-17 19:00:02 +0100, Tomas Vondra wrote: >> On 1/17/23 18:02, Andres Freund wrote: >>> On 2023-01-17 15:52:07 +0100, Tomas Vondra wrote: That also does not have issues with timestamp "rounding" - considering e.g. sample rate

Re: Sampling-based timing for EXPLAIN ANALYZE

2023-01-17 Thread Andres Freund
Hi, On 2023-01-17 19:00:02 +0100, Tomas Vondra wrote: > On 1/17/23 18:02, Andres Freund wrote: > > On 2023-01-17 15:52:07 +0100, Tomas Vondra wrote: > >> That also does not have issues with timestamp "rounding" - considering > >> e.g. sample rate 1000Hz, that's 1ms between samples. And it's quite

Re: Sampling-based timing for EXPLAIN ANALYZE

2023-01-17 Thread Tomas Vondra
On 1/17/23 18:02, Andres Freund wrote: > Hi, > > On 2023-01-17 15:52:07 +0100, Tomas Vondra wrote: >> I don't understand why we would even use timestamps, in this case? AFAIK >> "sampling profilers" simply increment a counter for the executing node, >> and then approximate the time as

Re: Sampling-based timing for EXPLAIN ANALYZE

2023-01-17 Thread Andres Freund
Hi, On 2023-01-17 15:52:07 +0100, Tomas Vondra wrote: > I don't understand why we would even use timestamps, in this case? AFAIK > "sampling profilers" simply increment a counter for the executing node, > and then approximate the time as proportional to the count. The timer interrupt distances

Re: Sampling-based timing for EXPLAIN ANALYZE

2023-01-17 Thread Tomas Vondra
On 1/15/23 21:22, Andres Freund wrote: > Hi, > > On 2023-01-13 09:11:06 +0100, David Geier wrote: >> Mostly I'm wondering if the sampling based approach gains us enough to be >> worth it, once the patch to use RDTSC hopefully landed (see [1]). > > Well, I'm not sure we have a path forward on

Re: Sampling-based timing for EXPLAIN ANALYZE

2023-01-17 Thread Lukas Fittl
On Fri, Jan 6, 2023 at 1:19 AM Jelte Fennema wrote: > Nice addition! And the code looks pretty straight forward. > Thanks for reviewing! The current patch triggers warnings: > https://cirrus-ci.com/task/6016013976731648 Looks like you need to add > void as the argument. > Fixed in v2

Re: Sampling-based timing for EXPLAIN ANALYZE

2023-01-15 Thread Andres Freund
Hi, On 2023-01-13 09:11:06 +0100, David Geier wrote: > Mostly I'm wondering if the sampling based approach gains us enough to be > worth it, once the patch to use RDTSC hopefully landed (see [1]). Well, I'm not sure we have a path forward on it. There's portability and accuracy concerns. But

Re: Sampling-based timing for EXPLAIN ANALYZE

2023-01-13 Thread David Geier
Nice idea. On 1/6/23 10:19, Jelte Fennema wrote: Do you have some performance comparison between TIMING ON and TIMING SAMPLING? +1 to see some numbers compared to TIMING ON. Mostly I'm wondering if the sampling based approach gains us enough to be worth it, once the patch to use RDTSC

Re: Sampling-based timing for EXPLAIN ANALYZE

2023-01-06 Thread Jelte Fennema
Nice addition! And the code looks pretty straight forward. The current patch triggers warnings: https://cirrus-ci.com/task/6016013976731648 Looks like you need to add void as the argument. Do you have some performance comparison between TIMING ON and TIMING SAMPLING? In InstrStartSampling

Sampling-based timing for EXPLAIN ANALYZE

2023-01-02 Thread Lukas Fittl
Hi, Since EXPLAIN ANALYZE with TIMING ON still carries noticeable overhead on modern hardware (despite time sources being faster), I'd like to propose a new setting EXPLAIN ANALYZE, called "TIMING SAMPLING", as compared to TIMING ON. This new timing mode uses a timer on a fixed recurring