[Postgres-xl-developers] 答复: stats_ext case of regression test(Internet mail)

senhu(胡森) senhu at tencent.com
Wed Aug 9 18:17:56 PDT 2017


Hi,tomas:
    I'll check the patch again, and do the improvements according to your suggestions, then share it later.

regards

senhu (senhu at tencent.com)


-----邮件原件-----
发件人: Tomas Vondra [mailto:tomas.vondra at 2ndquadrant.com] 
发送时间: 2017年8月10日 5:10
收件人: senhu(胡森); postgres-xl-developers at lists.postgres-xl.org
主题: Re: [Postgres-xl-developers] stats_ext case of regression test(Internet mail)

Hello Senhu,

On 08/09/2017 10:16 AM, senhu(胡森) wrote:
> Hello:
> 
> In stats_ext case, when we CREATE STATISTICS on MATERIALIZED VIEW, we 
> get the error message “relation xxx does not exist”.
 >
> The MATERIALIZED VIEW/VIEW is created only on coordinators, but CREATE 
> STATISTICS is executed on all nodes, so all datanodes report the 
> errors. To avoid the errors, I do some check before CREATE STATISTICS. 
> If target is MATERIALIZED VIEW, just execute on all coordinators, and 
> others on all nodes.
 >

Thanks for the patch. I agree not propagating the CREATE STATISTICS to datanodes for materialized views, seems like a sensible solution to the regression failure.

The patch needs some minor improvements, though:

1) Please add a comment explaining why materialized views are handled differently compared to other relkinds.

2) Do we really need to check that the Oid is valid? Perhaps because we're calling RangeVarGetRelid() with missing_ok=true. But why should it be OK not to find the relation? If we indeed need to do it this way, why are we silently ignoring the case of invalid Oid?

3) Perhaps CreateStatistics() does not need the check because it's using relation_openrv(), which will do elog(ERROR) for invalid Oids. Wouldn't that be more convenient here too, and it also returns a Relation which is what we're after anyway?


regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



More information about the Postgres-xl-developers mailing list