Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
8b2450c8
Commit
8b2450c8
authored
Sep 02, 2003
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a couple typos, add some more comments.
parent
39673ca4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
src/backend/access/hash/README
src/backend/access/hash/README
+15
-4
No files found.
src/backend/access/hash/README
View file @
8b2450c8
$Header: /cvsroot/pgsql/src/backend/access/hash/README,v 1.
1 2003/09/01 20:24:49
tgl Exp $
$Header: /cvsroot/pgsql/src/backend/access/hash/README,v 1.
2 2003/09/02 03:29:01
tgl Exp $
This directory contains an implementation of hash indexing for Postgres.
This directory contains an implementation of hash indexing for Postgres.
...
@@ -189,7 +189,7 @@ The insertion algorithm is rather similar:
...
@@ -189,7 +189,7 @@ The insertion algorithm is rather similar:
read/sharelock meta page
read/sharelock meta page
compute bucket number for target hash key
compute bucket number for target hash key
release meta page
release meta page
share-lock bucket page (to prevent split/compact this bucket)
share-lock bucket page (to prevent split/compact
of
this bucket)
release page 0 share-lock
release page 0 share-lock
-- (so far same as reader)
-- (so far same as reader)
read/exclusive-lock current page of bucket
read/exclusive-lock current page of bucket
...
@@ -334,7 +334,7 @@ Obtaining an overflow page:
...
@@ -334,7 +334,7 @@ Obtaining an overflow page:
release bitmap page
release bitmap page
loop back to try next bitmap page, if any
loop back to try next bitmap page, if any
-- here when we have checked all bitmap pages; we hold meta excl. lock
-- here when we have checked all bitmap pages; we hold meta excl. lock
extend index to add another
bitmap
page; update meta information
extend index to add another
overflow
page; update meta information
write/release meta page
write/release meta page
return page number
return page number
...
@@ -344,6 +344,12 @@ concurrency against processes just entering the index. We don't want
...
@@ -344,6 +344,12 @@ concurrency against processes just entering the index. We don't want
to hold the metapage exclusive lock while reading in a bitmap page.
to hold the metapage exclusive lock while reading in a bitmap page.
(We can at least avoid repeated buffer pin/unpin here.)
(We can at least avoid repeated buffer pin/unpin here.)
The normal path for extending the index does not require doing I/O while
holding the metapage lock. We do have to do I/O when the extension
requires adding a new bitmap page as well as the required overflow page
... but that is an infrequent case, so the loss of concurrency seems
acceptable.
The portion of tuple insertion that calls the above subroutine looks
The portion of tuple insertion that calls the above subroutine looks
like this:
like this:
...
@@ -392,7 +398,12 @@ algorithm is:
...
@@ -392,7 +398,12 @@ algorithm is:
release meta page
release meta page
We have to do it this way because we must clear the bitmap bit before
We have to do it this way because we must clear the bitmap bit before
changing the first-free-bit field.
changing the first-free-bit field (hashm_firstfree). It is possible that
we set first-free-bit too small (because someone has already reused the
page we just freed), but that is okay; the only cost is the next overflow
page acquirer will scan more bitmap bits than he needs to. What must be
avoided is having first-free-bit greater than the actual first free bit,
because then that free page would never be found by searchers.
All the freespace operations should be called while holding no buffer
All the freespace operations should be called while holding no buffer
locks. Since they need no lmgr locks, deadlock is not possible.
locks. Since they need no lmgr locks, deadlock is not possible.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment