Re: pg_stat_statements fingerprinting logic and ArrayExpr - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_stat_statements fingerprinting logic and ArrayExpr
Date
Msg-id 15759.1386725854@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_stat_statements fingerprinting logic and ArrayExpr  (Peter Geoghegan <pg@heroku.com>)
List pgsql-hackers
Peter Geoghegan <pg@heroku.com> writes:
> On Tue, Dec 10, 2013 at 3:08 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I'm wondering whether this doesn't indicate that we need to rethink where
>> the fingerprinter has been plugged in.  I'm not sure that somewhere in
>> the planner, post-constant-folding, would be a better place; but it's
>> worth thinking about.

> ... if you're not talking about blaming plans and not queries, you
> must be talking about making the planner do the constant folding in a
> way that facilitates tools like pg_stat_statements in getting the
> "essential nature" of the query (*not* the plan) post constant
> folding.

Yeah; if we were going to take this seriously, we'd need to do some
refactoring to separate normalization-type activities from other
planning activities.  I'm not sure it's worth the trouble.  Right
now, for instance, eval_const_expressions() also handles inlining
of SQL functions, which is a behavior we'd almost certainly *not*
want in front of query fingerprinting.  But it's hard to see how
we disentangle that without either lost optimization capacity
or duplicative processing.  A significant fraction of the point of
const-folding is to exploit opportunities revealed by inlining.

Anyway, I'm not volunteering to do this ;-) ... just idly speculating
about whether it'd be worth doing.
        regards, tom lane



pgsql-hackers by date:

Previous
From: "Sergey E. Koposov"
Date:
Subject: Re: ANALYZE sampling is too good
Next
From: "Etsuro Fujita"
Date:
Subject: Re: Get more from indices.