Re: BUG #17862: Overall query cost ignores window function - Mailing list pgsql-bugs

From David Rowley
Subject Re: BUG #17862: Overall query cost ignores window function
Date
Msg-id CAApHDvrwsqZDouZPv-JHgptwWwLarwuhzSYcD4DUo0j_uhWf2w@mail.gmail.com
Whole thread Raw
In response to Re: BUG #17862: Overall query cost ignores window function  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-bugs
On Sat, 25 Mar 2023 at 14:40, David Rowley <dgrowleyml@gmail.com> wrote:
> I think what it would take would be to look at each WindowFunc and
> then estimate how many rows we need to look at for each WindowClause
> and then take the Max of that number of rows and calculate the
> proportion of the subpath's total cost we need to use based on the
> number of estimated rows from the subpath.  I think the total subpath
> rows would need to be divided by the ndistinct estimate for the
> PARTITION BY clause too.

I've written patch to fix this and started a thread on -hackers [1] to
discuss it.

David

[1] https://postgr.es/m/CAApHDvrB0S5BMv+0-wTTqWFE-BJ0noWqTnDu9QQfjZ2VSpLv_g@mail.gmail.com



pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: ERROR: no NOT NULL constraint found to drop
Next
From: PG Bug reporting form
Date:
Subject: BUG #17892: Bug primary key