Re: Additional Statistics Hooks - Mailing list pgsql-hackers

From Euler Taveira
Subject Re: Additional Statistics Hooks
Date
Msg-id CAHE3wgjBcWaNv5-Kw1LoCKEYF3iG4M26z2MORt0p=2n1LsDvQQ@mail.gmail.com
Whole thread Raw
In response to Additional Statistics Hooks  (Mat Arye <mat@timescale.com>)
Responses Re: Additional Statistics Hooks  (Mat Arye <mat@timescale.com>)
List pgsql-hackers
2018-03-12 14:03 GMT-03:00 Mat Arye <mat@timescale.com>:
> I have a question about statistics hooks. I am trying to teach the planner
> that when grouping by something like date_trunc('1 day', time) will produce
> a lot less rows than the number of distinct time values. I want to do that
> in an extension. The problem is that I don't see a way to make the
> get_relation_stats_hook work well fo that since by the time it's called you
> only see the `time` var and not the full expression. None of the other hooks
> seem appropriate either. So 2 questions:
>
Isn't it the case to extend the available hook?

> 1) Would people be opposed to adding a code hook somewhere at the start of
> `examine_variable` (selfuncs.c) to allow creating statistics on complete
> expressions? I can submit a patch if this seems reasonable.
>
If you explain the use case maybe it could be considered.

> 2) Do patches that add code hooks (and are probably under 10 lines) need to
> go through the entire commitfest process. I guess what I am really asking is
> if PG12 would be the first version such a patch could appear in or is PG11
> still a possibility? Just wondering what the policy on such stuff is.
>
If it is a new feature and is not in the last CF, it won't be
considered for v11 (even small patches).


-- 
   Euler Taveira                                   Timbira -
http://www.timbira.com.br/
   PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento


pgsql-hackers by date:

Previous
From: Grigory Smolkin
Date:
Subject: Re: Function to track shmem reinit time
Next
From: Dave Page
Date:
Subject: Re: Re: [GSOC 18] Performance Farm Project——Initialization Project