Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8ac700a

Browse files
committed
doc: Clarify behavior of query planner locking with REINDEX
The documentation of REINDEX has never mentioned that the query plannermay take an ACCESS SHARE lock on the indexes depending on the queryused. This adds also a note about prepared queries not impacted whenthey do not use the index(es) rebuilt.Author: Frédéric YhuelReviewed-by: Guillaume Lelarge, Justin PryzbyDiscussion:https://postgr.es/m/65d08718-6f11-978a-4b5a-72b807d4c663@dalibo.com
1 parentcd959b1 commit8ac700a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎doc/src/sgml/ref/reindex.sgml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,12 @@ REINDEX [ ( <replaceable class="parameter">option</replaceable> [, ...] ) ] { IN
275275
considerations are rather different. <command>REINDEX</command> locks out writes
276276
but not reads of the index's parent table. It also takes an
277277
<literal>ACCESS EXCLUSIVE</literal> lock on the specific index being processed,
278-
which will block reads that attempt to use that index. In contrast,
278+
which will block reads that attempt to use that index. In particular,
279+
the query planner tries to take an <literal>ACCESS SHARE</literal>
280+
lock on every index of the table, regardless of the query, and so
281+
<command>REINDEX</command> blocks virtually any queries except for some
282+
prepared queries whose plan has been cached and which don't use this very
283+
index. In contrast,
279284
<command>DROP INDEX</command> momentarily takes an
280285
<literal>ACCESS EXCLUSIVE</literal> lock on the parent table, blocking both
281286
writes and reads. The subsequent <command>CREATE INDEX</command> locks out

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp