Statistical aggregate functions are not working with partitionwise aggregate

Поиск
Список
Период
Сортировка
Искать
От
Rajkumar Raghuwanshi
Тема
Statistical aggregate functions are not working with partitionwise aggregate
Дата
в 09:26:04
Msg-id
CAKcux6=uZEyWyLw0N7HtR9OBc-sWEFeByEZC7t-KDf15FKxVew@mail.gmail.com
Список
Дерево обсуждения
Statistical aggregate functions are not working with partitionwise aggregate Rajkumar Raghuwanshi <rajkumar.raghuwanshi@enterprisedb.com>
Re: Statistical aggregate functions are not working withpartitionwise aggregate Jeevan Chalke <jeevan.chalke@enterprisedb.com>
Statistical aggregate functions are not working with PARTIAL aggregation Rajkumar Raghuwanshi <rajkumar.raghuwanshi@enterprisedb.com>
Re: Statistical aggregate functions are not working with PARTIALaggregation Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Hi,

On PG-head, Some of statistical aggregate function are not giving correct output when enable partitionwise aggregate while same is working on v11.

below are some of examples.

CREATE TABLE tbl(a int2,b float4) partition by range(a);
create table tbl_p1 partition of tbl for values from (minvalue) to (0);
create table tbl_p2 partition of tbl for values from (0) to (maxvalue);
insert into tbl values (-1,-1),(0,0),(1,1),(2,2);

--when partitionwise aggregate is off
postgres=# SELECT regr_count(b, a) FROM tbl;
 regr_count
------------
          4
(1 row)
postgres=# SELECT regr_avgx(b, a), regr_avgy(b, a) FROM tbl;
 regr_avgx | regr_avgy
-----------+-----------
       0.5 |       0.5
(1 row)
postgres=# SELECT corr(b, a) FROM tbl;
 corr
------
    1
(1 row)

--when partitionwise aggregate is on
postgres=# SET enable_partitionwise_aggregate = true;
SET
postgres=# SELECT regr_count(b, a) FROM tbl;
 regr_count
------------
          0
(1 row)
postgres=# SELECT regr_avgx(b, a), regr_avgy(b, a) FROM tbl;
 regr_avgx | regr_avgy
-----------+-----------
           |         
(1 row)
postgres=# SELECT corr(b, a) FROM tbl;
 corr
------
    
(1 row)

Thanks & Regards,
Rajkumar Raghuwanshi
QMG, EnterpriseDB Corporation
В списке pgsql-hackers по дате отправления
От: Amit Kapila
Дата:
От: Jeevan Chalke
Дата:
FAQ