Re: Suggest note in index documentation about long running transactions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Chris Travers <chris(dot)travers(at)gmail(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Suggest note in index documentation about long running transactions
Date: 2016-02-16 15:54:44
Message-ID: 23839.1455638084@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Chris Travers <chris(dot)travers(at)gmail(dot)com> writes:
> Unless there is a sense that this is a bad idea I will submit a doc patch.

I was already working on it ... I think what we want is something along
this line in the "Building Indexes Concurrently" section of the CREATE
INDEX ref page:

*** create_index.sgml.orig Tue Feb 2 10:56:09 2016
--- create_index.sgml Tue Feb 16 10:48:38 2016
*************** CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ]
*** 443,448 ****
--- 443,452 ----
scan starts. Concurrent index creation serially waits for each old
transaction to complete using the method outlined in section <xref
linkend="view-pg-locks">.
+ In addition, once the <command>CREATE INDEX CONCURRENTLY</> command does
+ complete, the index is still not immediately ready for use: it cannot
+ be used until all transactions that were active when index creation
+ started are gone.
</para>

<para>

However, now that I look at it, the existing text in this para is kind of
a mess too. That cross-reference to pg_locks, for example, seems
gratuitous and confusing (because what it's pointing you at is a single
sentence deeply buried in a rather long page). It's also not very clear
what is meant by "Any transaction active when the second table scan starts
can block concurrent index creation until it completes"; I think we need
to be a little clearer about when that happens or doesn't happen.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message hubert depesz lubaczewski 2016-02-16 16:15:39 Re: [SQL] refer function name by a variable in the function body
Previous Message Suresh Raja 2016-02-16 15:41:18 refer function name by a variable in the function body