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
fcb4bfdd
Commit
fcb4bfdd
authored
Mar 10, 2016
by
Simon Riggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce lock level for altering fillfactor
Fabrízio de Royes Mello and Simon Riggs
parent
090b287f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
18 deletions
+18
-18
doc/src/sgml/ref/alter_table.sgml
doc/src/sgml/ref/alter_table.sgml
+1
-1
src/backend/access/common/reloptions.c
src/backend/access/common/reloptions.c
+5
-5
src/test/regress/expected/alter_table.out
src/test/regress/expected/alter_table.out
+12
-12
No files found.
doc/src/sgml/ref/alter_table.sgml
View file @
fcb4bfdd
...
@@ -561,7 +561,7 @@ ALTER TABLE ALL IN TABLESPACE <replaceable class="PARAMETER">name</replaceable>
...
@@ -561,7 +561,7 @@ ALTER TABLE ALL IN TABLESPACE <replaceable class="PARAMETER">name</replaceable>
</para>
</para>
<para>
<para>
Changing autovacuum storage parameters acquires a <literal>SHARE UPDATE EXCLUSIVE</literal> lock.
Changing
fillfactor and
autovacuum storage parameters acquires a <literal>SHARE UPDATE EXCLUSIVE</literal> lock.
</para>
</para>
<note>
<note>
...
...
src/backend/access/common/reloptions.c
View file @
fcb4bfdd
...
@@ -100,7 +100,7 @@ static relopt_int intRelOpts[] =
...
@@ -100,7 +100,7 @@ static relopt_int intRelOpts[] =
"fillfactor"
,
"fillfactor"
,
"Packs table pages only to this percentage"
,
"Packs table pages only to this percentage"
,
RELOPT_KIND_HEAP
,
RELOPT_KIND_HEAP
,
AccessExclusiveLock
ShareUpdateExclusiveLock
/* since it applies only to later inserts */
},
},
HEAP_DEFAULT_FILLFACTOR
,
HEAP_MIN_FILLFACTOR
,
100
HEAP_DEFAULT_FILLFACTOR
,
HEAP_MIN_FILLFACTOR
,
100
},
},
...
@@ -109,7 +109,7 @@ static relopt_int intRelOpts[] =
...
@@ -109,7 +109,7 @@ static relopt_int intRelOpts[] =
"fillfactor"
,
"fillfactor"
,
"Packs btree index pages only to this percentage"
,
"Packs btree index pages only to this percentage"
,
RELOPT_KIND_BTREE
,
RELOPT_KIND_BTREE
,
AccessExclusiveLock
ShareUpdateExclusiveLock
/* since it applies only to later inserts */
},
},
BTREE_DEFAULT_FILLFACTOR
,
BTREE_MIN_FILLFACTOR
,
100
BTREE_DEFAULT_FILLFACTOR
,
BTREE_MIN_FILLFACTOR
,
100
},
},
...
@@ -118,7 +118,7 @@ static relopt_int intRelOpts[] =
...
@@ -118,7 +118,7 @@ static relopt_int intRelOpts[] =
"fillfactor"
,
"fillfactor"
,
"Packs hash index pages only to this percentage"
,
"Packs hash index pages only to this percentage"
,
RELOPT_KIND_HASH
,
RELOPT_KIND_HASH
,
AccessExclusiveLock
ShareUpdateExclusiveLock
/* since it applies only to later inserts */
},
},
HASH_DEFAULT_FILLFACTOR
,
HASH_MIN_FILLFACTOR
,
100
HASH_DEFAULT_FILLFACTOR
,
HASH_MIN_FILLFACTOR
,
100
},
},
...
@@ -127,7 +127,7 @@ static relopt_int intRelOpts[] =
...
@@ -127,7 +127,7 @@ static relopt_int intRelOpts[] =
"fillfactor"
,
"fillfactor"
,
"Packs gist index pages only to this percentage"
,
"Packs gist index pages only to this percentage"
,
RELOPT_KIND_GIST
,
RELOPT_KIND_GIST
,
AccessExclusiveLock
ShareUpdateExclusiveLock
/* since it applies only to later inserts */
},
},
GIST_DEFAULT_FILLFACTOR
,
GIST_MIN_FILLFACTOR
,
100
GIST_DEFAULT_FILLFACTOR
,
GIST_MIN_FILLFACTOR
,
100
},
},
...
@@ -136,7 +136,7 @@ static relopt_int intRelOpts[] =
...
@@ -136,7 +136,7 @@ static relopt_int intRelOpts[] =
"fillfactor"
,
"fillfactor"
,
"Packs spgist index pages only to this percentage"
,
"Packs spgist index pages only to this percentage"
,
RELOPT_KIND_SPGIST
,
RELOPT_KIND_SPGIST
,
AccessExclusiveLock
ShareUpdateExclusiveLock
/* since it applies only to later inserts */
},
},
SPGIST_DEFAULT_FILLFACTOR
,
SPGIST_MIN_FILLFACTOR
,
100
SPGIST_DEFAULT_FILLFACTOR
,
SPGIST_MIN_FILLFACTOR
,
100
},
},
...
...
src/test/regress/expected/alter_table.out
View file @
fcb4bfdd
...
@@ -2065,19 +2065,19 @@ select * from my_locks order by 1;
...
@@ -2065,19 +2065,19 @@ select * from my_locks order by 1;
commit;
commit;
begin; alter table alterlock set (fillfactor = 100);
begin; alter table alterlock set (fillfactor = 100);
select * from my_locks order by 1;
select * from my_locks order by 1;
relname |
max_lockmode
relname |
max_lockmode
-----------+---------------------
-----------+---------------------
-----
alterlock |
Access
ExclusiveLock
alterlock |
ShareUpdate
ExclusiveLock
pg_toast |
Access
ExclusiveLock
pg_toast |
ShareUpdate
ExclusiveLock
(2 rows)
(2 rows)
commit;
commit;
begin; alter table alterlock reset (fillfactor);
begin; alter table alterlock reset (fillfactor);
select * from my_locks order by 1;
select * from my_locks order by 1;
relname |
max_lockmode
relname |
max_lockmode
-----------+---------------------
-----------+---------------------
-----
alterlock |
Access
ExclusiveLock
alterlock |
ShareUpdate
ExclusiveLock
pg_toast |
Access
ExclusiveLock
pg_toast |
ShareUpdate
ExclusiveLock
(2 rows)
(2 rows)
commit;
commit;
...
@@ -2110,10 +2110,10 @@ rollback;
...
@@ -2110,10 +2110,10 @@ rollback;
-- test that mixing options with different lock levels works as expected
-- test that mixing options with different lock levels works as expected
begin; alter table alterlock set (autovacuum_enabled = off, fillfactor = 80);
begin; alter table alterlock set (autovacuum_enabled = off, fillfactor = 80);
select * from my_locks order by 1;
select * from my_locks order by 1;
relname |
max_lockmode
relname |
max_lockmode
-----------+---------------------
-----------+---------------------
-----
alterlock |
Access
ExclusiveLock
alterlock |
ShareUpdate
ExclusiveLock
pg_toast |
Access
ExclusiveLock
pg_toast |
ShareUpdate
ExclusiveLock
(2 rows)
(2 rows)
commit;
commit;
...
...
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