Re: Documentation for partitioned indexes?

"Jonathan S. Katz" <[email protected]>
Newsgroups gmane.comp.db.postgresql.devel.documentation
Message-ID <[email protected]>
On 4/26/19 2:53 PM, Alvaro Herrera wrote:
> On 2019-Apr-26, Tom Lane wrote:
> 
>> We appear to have a fair amount of support now for operations like
>> constructing a partitioned index piecemeal, e.g. adding indexes
>> to the partitions one at a time and then attaching them to a
>> parent partitioned index, with the parent ultimately transitioning
>> from "not valid" to "valid" once all the pieces are attached.
>>
>> However, I cannot find any coherent documentation explaining how
>> to do this (or why you'd want to).  Am I just looking in the wrong
>> places?
> 
> Hmm.  Under Notes for CREATE INDEX there is a paragraph on this:
> 
> 	When CREATE INDEX is invoked on a partitioned table, the default
> 	behavior is to recurse to all partitions to ensure they all have
> 	matching indexes. Each partition is first checked to determine
> 	whether an equivalent index already exists, and if so, that
> 	index will become attached as a partition index to the index
> 	being created, which will become its parent index. If no
> 	matching index exists, a new index will be created and
> 	automatically attached; the name of the new index in each
> 	partition will be determined as if no index name had been
> 	specified in the command. If the ONLY option is specified, no
> 	recursion is done, and the index is marked invalid. (ALTER INDEX
> 	... ATTACH PARTITION marks the index valid, once all partitions
> 	acquire matching indexes.) Note, however, that any partition
> 	that is created in the future using CREATE TABLE ... PARTITION
> 	OF will automatically have a matching index, regardless of
> 	whether ONLY is specified.
> 
> I suppose I better add something in Chapter 5 (DDL), possibly inside the
> 5.10 section (Table Partitioning) -- a new 5.10.6 "Indexes for
> Partitioned Tables" perhaps?

+1; (though note on devel it's section 5.11, not that it matters in the
SGML)

I'd suggest keeping the title of the section similar to the one with
constraints, i.e. "Partitioning and Indexes"

Thanks,

Jonathan
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE+oS2la8r95ogZD/x8QSccp8cZScFAlzDVvQACgkQ8QSccp8c
ZSf7lg/8C+UlaIDWtcJTzdcdTSEN1nCgqiyBiwUrkEdgj7vnlK3kla7CYXrMJJNw
Pa8jKujrnAoVStJLgCyWfd1CX+XvNYHCbTxVuo+O9Cwguc785mwt+JmY3lCz4K6y
2IF7xwcWkRF09Q/3YGI08LyKP2FPtxZ9+K3n/7Kqfc83+QlmHll2IF884w4iPv6T
J/uJf8+tYuGp0vwqt0wwdKgDkRNWdMUpA2GYF3HJdcXeZ8yrizYMQMJOD+itezPw
pMhu61sCMb3KBuJrggyM767Lx+MGQ//xvVHnFEF9PVnvuHVw/0gZlDkE/Z5gyz40
UOD4tzHr3SY1cpZmueDtZyA4rNMxqLDfR3V+rpvm9nt9LoM/50H3eGyj2Oed10zz
ad643KFO4W8z6uvxktSm+kvEN9Wtha3VC9pBBeIYpxuQpQYg7L9Opgx4Igqn9IDE
Mku3RbBXyw06X+nM8Md6/5jwvh8EODBvxbk7htkY57XhLpkJ/jW+h5WzzzsfNxwH
LxWK8FuCddqyk+t8oZnG/HtDUCBUs5T3cwBWm7nP3kQKbV+Il9HTL3JEulAmE33x
v3rIeSWeSMmUVnMRpeocq/nL2kQC+D7YztxIWhoKZc84+NORvn+tPQ74X/Ra+DPd
+KQUtJQcizCqTd1IXUx0NI2NmXjp/Y+GBBsg42br1qYpTHfw7a8=
=ZS0I
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.