On Fri, Mar 26, 2021 at 11:07 AM Amit Kapila <[email protected]> wrote: > > On Wed, Mar 24, 2021 at 12:14 AM Andres Freund <[email protected]> wrote: > > > > > > Shouldn't we have this in IndexOptInfo already? > > > > No, because I think we don't build IndexOptInfo for target tables > (tables in which insert is performed). It is only built for tables to > scan. However, I think here we could cache parallel-safety info in the > index rel descriptor and can use it for next time. This will avoid > checking expressions each time. >
On further investigation, it seems we can't rely on the cached information of parallel-safety in rel descriptor because we don't invalidate it if someone changes function property say from safe to unsafe or vice-versa. We need to think of some other idea here, simply caching rel descriptors won't work. I think we need to further discuss this topic on -hackers. -- With Regards, Amit Kapila.
