[HACKERS] Print correct startup cost for the group aggregate.
От | Rushabh Lathia |
---|---|
Тема | [HACKERS] Print correct startup cost for the group aggregate. |
Дата | |
Msg-id | CAGPqQf099_D2EELO3Fc28Zpb=6Q4m0CHP8EUGHAunUU1P1Zn7A@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: [HACKERS] Print correct startup cost for the group aggregate.
|
Список | pgsql-hackers |
Hi,
While reading through the cost_agg() I found that startup cost for the
group aggregate is not correctly assigned. Due to this explain plan is
not printing the correct startup cost.
Without patch:
postgres=# explain select aid, sum(abalance) from pgbench_accounts where filler like '%foo%' group by aid;
QUERY PLAN
-------------------------------------------------------------------------------------
GroupAggregate (cost=81634.33..85102.04 rows=198155 width=12)
Group Key: aid
-> Sort (cost=81634.33..82129.72 rows=198155 width=8)
Sort Key: aid
-> Seq Scan on pgbench_accounts (cost=0.00..61487.89 rows=198155 width=8)
Filter: (filler ~~ '%foo%'::text)
(6 rows)
With patch:
postgres=# explain select aid, sum(abalance) from pgbench_accounts where filler like '%foo%' group by aid;
QUERY PLAN
-------------------------------------------------------------------------------------
GroupAggregate (cost=82129.72..85102.04 rows=198155 width=12)
Group Key: aid
-> Sort (cost=81634.33..82129.72 rows=198155 width=8)
Sort Key: aid
-> Seq Scan on pgbench_accounts (cost=0.00..61487.89 rows=198155 width=8)
Filter: (filler ~~ '%foo%'::text)
(6 rows)
PFA patch to correct the same.
Regards, While reading through the cost_agg() I found that startup cost for the
group aggregate is not correctly assigned. Due to this explain plan is
not printing the correct startup cost.
Without patch:
postgres=# explain select aid, sum(abalance) from pgbench_accounts where filler like '%foo%' group by aid;
QUERY PLAN
-------------------------------------------------------------------------------------
GroupAggregate (cost=81634.33..85102.04 rows=198155 width=12)
Group Key: aid
-> Sort (cost=81634.33..82129.72 rows=198155 width=8)
Sort Key: aid
-> Seq Scan on pgbench_accounts (cost=0.00..61487.89 rows=198155 width=8)
Filter: (filler ~~ '%foo%'::text)
(6 rows)
With patch:
postgres=# explain select aid, sum(abalance) from pgbench_accounts where filler like '%foo%' group by aid;
QUERY PLAN
-------------------------------------------------------------------------------------
GroupAggregate (cost=82129.72..85102.04 rows=198155 width=12)
Group Key: aid
-> Sort (cost=81634.33..82129.72 rows=198155 width=8)
Sort Key: aid
-> Seq Scan on pgbench_accounts (cost=0.00..61487.89 rows=198155 width=8)
Filter: (filler ~~ '%foo%'::text)
(6 rows)
PFA patch to correct the same.
Rushabh Lathia
Вложения
В списке pgsql-hackers по дате отправления: