Hello, When we add a new path using add_path(), it checks estimated cost and path-keys, then it also removes dominated paths, if any. Do we have a reasonable way to retain these "dominated" paths? Once it is considered lesser paths at a level, however, it may have a combined cheaper cost with upper pathnode.
In my case, PG-Strom adds CustomPath to support JOIN/GROUP BY workloads that utilizes GPU and NVME storage. If GpuPreAgg and GpuJoin are executed continuously, output buffer of GpuJoin simultaneously performs as input buffer of GpuPreAgg on GPU device memory. So, it allows to avoid senseless DMA transfer between GPU and CPU/RAM. This behavior affects cost estimation during path construction steps - GpuPreAgg discount DMA cost if its input path is GpuJoin. On the other hands, it looks to me add_path() does not consider upper level optimization other than sorting path-keys. As long as we can keep these "lesser" pathnodes that has further optimization chance, it will help making more reasonable query plan. Do we have any reasonable way to retain these paths at add_path() even if it is dominated by other paths? Any idea welcome. Best regards, [*] GpuJoin + GpuPreAgg combined GPU kernel https://www.slideshare.net/kaigai/20181016pgconfeussd2gpumulti/13 -- HeteroDB, Inc / The PG-Strom Project KaiGai Kohei <kai...@heterodb.com>