• Bruce Momjian's avatar
    Fixes for query_id feature · 0f61727b
    Bruce Momjian authored
    Ignore parallel workers in pg_stat_statements
      Oversight in 4f0b0966 which exposed queryid in parallel workers.
      Counters are aggregated by the main backend process so parallel workers
      would report duplicated activity, and could also report activity for the
      wrong entry as they are only aware of the top level queryid.
    
    Fix thinko in pg_stat_get_activity when retrieving the queryid.
    
    Remove unnecessary call to pgstat_report_queryid().
    
    Reported-by: Amit Kapila, Andres Freund, Thomas Munro
    
    Discussion: https://postgr.es/m/20210408051735.lfbdzun5zdlax5gd@alap3.anarazel.de p634GTSOqnDW86Owrn6qDAVosC5dJjXjp7BMfc5Gz1Q@mail.gmail.com
    
    Author: Julien Rouhaud
    0f61727b
execParallel.c 46.4 KB