Re: BUG #17862: Overall query cost ignores window function
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: Tim Palmer <tim3sp@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Date: 2023-04-12T09:05:55Z
Lists: 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
Commits
-
Account for startup rows when costing WindowAggs
- 3900a02c97c7 17.0 landed