Re: partition wise aggregate wrong rows cost

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: bucoo <bucoo(at)sohu(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: partition wise aggregate wrong rows cost
Date: 2022-05-24 04:16:25
Message-ID: 1418325.1653365785@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

David Rowley <dgrowleyml(at)gmail(dot)com> writes:
> On Tue, 24 May 2022 at 15:38, bucoo <bucoo(at)sohu(dot)com> wrote:
>> Normal aggregate and partition wise aggregate have a big difference rows cost:

> I wouldn't say this is a bug. Could you not say that they're both
> wrong given that your tables are empty?

We try fairly hard to ensure that the rowcount estimate for a given
relation does not vary across paths, so I concur with the OP that
this is a bug. Having said that, I'm not sure that the consequences
are significant. As you say, the estimates seem to get a lot closer
as soon as the table has some statistics. (But nonetheless, they
are not identical, so it's still a bug.)

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Steve Chavez 2022-05-24 04:39:16 Assert name/short_desc to prevent SHOW ALL segfault
Previous Message David Rowley 2022-05-24 03:58:12 Re: partition wise aggregate wrong rows cost