Re: Synchronized scans - Mailing list pgsql-patches

From Gregory Stark
Subject Re: Synchronized scans
Date
Msg-id 876463uyl3.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: Synchronized scans  (Heikki Linnakangas <heikki@enterprisedb.com>)
List pgsql-patches
"Heikki Linnakangas" <heikki@enterprisedb.com> writes:

> Were you thinking of storing the PID of the backend that originally created the
> hint, or updating the PID every time the hint is updated? In any case, we still
> wouldn't know if there's other scanners still running.

My reaction was if you always put the pid in when updating the hint it might
work out pretty well. When you finish you remove the hint iff the pid is your
own.

It has exactly the same properties you describe of leaving a small window with
no hint when you finish a scan but only if you were the last to update the
scan position which i would expect would be pretty rare except for the last
scanner.

If a backend died it would leave a scan position behind but the next scanner
on that table would overwrite the pid and then remove it when it's finished.

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com


pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Synchronized scans
Next
From: Gregory Stark
Date:
Subject: Re: Synchronized scans