I ran that original test case with and without the patch. Here are the
numbers I'm seeing:
master (best of three):
postgres=# SELECT count(*) FROM lotsarows;
Time: 582.423 ms
postgres=# EXPLAIN (ANALYZE, TIMING OFF) SELECT count(*) FROM lotsarows;
Time: 616.102 ms
postgres=# EXPLAIN (ANALYZE, TIMING ON) SELECT count(*) FROM lotsarows;
Time: 1068.700 ms (00:01.069)
patched (best of three):
postgres=# SELECT count(*) FROM lotsarows;
Time: 550.822 ms
postgres=# EXPLAIN (ANALYZE, TIMING OFF) SELECT count(*) FROM lotsarows;
Time: 612.572 ms
postgres=# EXPLAIN (ANALYZE, TIMING ON) SELECT count(*) FROM lotsarows;
Time: 690.875 ms
On Fri, Jul 1, 2022 at 10:26 AM Andres Freund <andres@anarazel.de> wrote:
> On 2022-07-01 01:23:01 -0700, Lukas Fittl wrote:
>...
> > Known WIP problems with this patch version:
> >
> > * There appears to be a timing discrepancy I haven't yet worked out, where
> > the \timing data reported by psql doesn't match what EXPLAIN ANALYZE is
> > reporting. With Andres' earlier test case, I'm seeing a consistent ~700ms
> > higher for \timing than for the EXPLAIN ANALYZE time reported on the
> > server
> > side, only when rdtsc measurement is used -- its likely there is a problem
> > somewhere with how we perform the cycles to time conversion
>
> Could you explain a bit more what you're seeing? I just tested your patches
> and didn't see that here.
I did not see this either, but I did see that the execution time
reported by \timing is (for this test case) consistently 0.5-1ms
*lower* than the Execution Time reported by EXPLAIN. I did not see
that on master. Is that expected?
Thanks,
Maciek