Re: Page Scan Mode in Hash Index
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Jesper Pedersen <jesper.pedersen@redhat.com>,
Ashutosh Sharma <ashu.coek88@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2017-09-20T10:34:48Z
Lists: pgsql-hackers
On Tue, Sep 19, 2017 at 11:34 PM, Amit Kapila <amit.kapila16@gmail.com> wrote: > This point has been discussed above [1] and to avoid this problem we > are keeping the scan always behind vacuum for unlogged and temporary > tables as we are doing without this patch. That will ensure vacuum > won't be able to remove the TIDs which we are going to mark as dead. > This has been taken care in patch 0003. I understand that this is > slightly ugly, but the other alternative (as mentioned in the email > [1]) is much worse. Hmm. So if I understand correctly, you're saying that the LSN check in patch 0001 is actually completely unnecessary if we only apply 0001, but is needed in preparation for 0003, after which it will really be doing something? In more detail, I suppose the idea is: a TID cannot be reused until a VACUUM has intervened; VACUUM always visits every data page in the index; we won't allow a scan to pass VACUUM (and thus possibly have one of its TIDs get reused) except when the LSN check is actually sufficient to guarantee no TID reuse (i.e. table is not unlogged). Page-at-a-time index vacuum as in _hash_vacuum_one_page doesn't matter because such an operation doesn't allow TIDs to be reused. Did I get it right? -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Commits
-
Remove lsn from HashScanPosData.
- 22c5e73562c5 11.0 landed
-
Fix trivial mistake in README.
- 79a4a665c046 11.0 landed
-
hash: Implement page-at-a-time scan.
- 7c75ef571579 11.0 landed
-
Reduce pinning and buffer content locking for btree scans.
- 2ed5b87f96d4 9.5.0 cited