pgsql: dshash: Add sequential scan support.
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Date: 2022-03-11T01:02:51Z
Lists: pgsql-hackers
dshash: Add sequential scan support. Add ability to scan all entries sequentially to dshash. The interface is similar but a bit different both from that of dynahash and simple dshash search functions. The most significant differences is that dshash's interfac always needs a call to dshash_seq_term when scan ends. Another is locking. Dshash holds partition lock when returning an entry, dshash_seq_next() also holds lock when returning an entry but callers shouldn't release it, since the lock is essential to continue a scan. The seqscan interface allows entry deletion while a scan is in progress using dshash_delete_current(). Reviewed-By: Andres Freund <andres@anarazel.de> Author: Kyotaro Horiguchi <horikyoga.ntt@gmail.com> Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/352d297dc74feb0bf0dcb255cc0dfaaed2b96c1e Modified Files -------------- src/backend/lib/dshash.c | 163 ++++++++++++++++++++++++++++++++++++++- src/include/lib/dshash.h | 23 ++++++ src/tools/pgindent/typedefs.list | 1 + 3 files changed, 186 insertions(+), 1 deletion(-)
Commits
-
Fix lock assertions in dshash.c.
- eed959a457ea 16.0 landed
- 53df1e28d2f7 15.0 landed
- cd26139a3056 11.17 landed
- 4f88dbac22a8 12.12 landed
- 7cdd0c2d7cdf 13.8 landed
- 5e7608e81ebb 14.5 landed
-
dshash: Add sequential scan support.
- 352d297dc74f 15.0 cited