Re: [HACKERS] JIT & function naming - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] JIT & function naming
Date
Msg-id 5231.1504447897@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] JIT & function naming  (Andres Freund <andres@anarazel.de>)
Responses Re: [HACKERS] JIT & function naming  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> Currently there's essentially a per EState counter and the generated
> functions get named deform$n and evalexpr$n. That allows for profiling
> of a single query, because different compiled expressions are
> disambiguated. It even allows to run the same query over and over, still
> giving meaningful results.  But it breaks down when running multiple
> queries while profiling - evalexpr0 can mean something entirely
> different for different queries.

> The best idea I have so far would be to name queries like
> evalexpr_$fingerprint_$n, but for that we'd need fingerprinting support
> outside of pg_stat_statement, which seems painful-ish.

Yeah.  Why not just use a static counter to give successive unique IDs
to each query that gets JIT-compiled?  Then the function names would
be like deform_$querynumber_$subexprnumber.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Jeevan Ladhe
Date:
Subject: Re: [HACKERS] Adding support for Default partition in partitioning
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Fix warnings and typo in dshash