On Thu, Dec 19, 2024 at 2:09 PM Jon Zeppieri <zeppieri@xxxxxxxxx> wrote: > > The row estimate is not good. The query estimates 317919 rows but > there are only 27701. There is some correlation here; if end_on is > null, start_on is a lot more likely to be recent, so maybe extended > statistics would be useful here. > Though, given that the index only contains rows where end_on is null, it seems odd that the planner would estimate more rows than are present in the index. That said, I have no idea whether the planner uses that sort of information. -J