Thread

  1. Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?

    Lukas Fittl <lukas@fittl.com> — 2023-01-02T19:50:04Z

    Hi David,
    
    Thanks for continuing to work on this patch, and my apologies for silence
    on the patch.
    
    Its been hard to make time, and especially so because I typically develop
    on an ARM-based macOS system where I can't test this directly - hence my
    tests with virtualized EC2 instances, where I ran into the timing oddities.
    
    On Mon, Jan 2, 2023 at 5:28 AM David Geier <geidav.pg@gmail.com> wrote:
    
    > The INSTR_TIME_GET_MICROSEC() returns a uint64 while the other variants
    > return double. This seems error prone. What about renaming the function
    > or also have the function return a double and cast where necessary at
    > the call site?
    >
    
    Minor note, but in my understanding using a uint64 (where we can) is faster
    for any simple arithmetic we do with the values.
    
    
    > If no one objects I would also re-register this patch in the commit fest.
    >
    
    +1, and feel free to carry this patch forward - I'll try to make an effort
    to review my earlier testing issues again, as well as your later
    improvements to the patch.
    
    Also, FYI, I just posted an alternate idea for speeding up EXPLAIN ANALYZE
    with timing over in [0], using a sampling-based approach to reduce the
    timing overhead.
    
    [0]:
    https://www.postgresql.org/message-id/CAP53PkxXMk0j-%2B0%3DYwRti2pFR5UB2Gu4v2Oyk8hhZS0DRART6g%40mail.gmail.com
    
    Thanks,
    Lukas
    
    -- 
    Lukas Fittl