On Thu, Apr 11, 2019 at 12:49 PM Andres Freund <andres@anarazel.de> wrote:
> > @@ -179,6 +184,12 @@ typedef struct TableAmRoutine
> > *
> > * if temp_snap is true, the snapshot will need to be deallocated at
> > * scan_end.
> > + *
> > + * HEIKKI: table_scan_update_snapshot() changes the snapshot. That's
> > + * a bit surprising for the AM, no? Can it be called when a scan is
> > + * already in progress?
>
> Yea, it can be called when the scan is in-progress. I think we probably
> should just fix calling code to not need that - it's imo weird that
> nodeBitmapHeapscan.c doesn't just delay starting the scan till it has
> the snapshot. This isn't new code, but it's now going to be exposed to
> more AMs, so I think there's a good argument to fix it now.
>
> Robert: You committed that addition, in
>
> commit f35742ccb7aa53ee3ed8416bbb378b0c3eeb6bb9
> Author: Robert Haas <rhaas@postgresql.org>
> Date: 2017-03-08 12:05:43 -0500
>
> Support parallel bitmap heap scans.
>
> do you remember why that's done?
I don't think there was any brilliant idea behind it. Delaying the
scan start until it has the snapshot seems like a good idea.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company