BRIN
brin 索引访问方法。
当前阅读 PG 19·选择有来源记录的版本
能力 · PostgreSQL 19
以下结论来自同版本文档。条件性能力取决于运算符类、索引类型或查询,不代表普遍保证。
| 能力 | 支持 | 条件与证据 |
|---|---|---|
| Sorted output | No | Ordinary sorted output is distinct from ordering by an operator, such as nearest-neighbor distance. 同版本文档
|
| Unique keys | No | This means a unique index. Exclusion constraints use a different contract. |
| Multiple key columns | Yes | Multiple search keys are distinct from non-key INCLUDE payload columns. 同版本文档
|
| INCLUDE columns | No | Payload columns do not become search keys. Wide payloads can exceed the index tuple-size limit. 同版本文档
|
| Index-only scans | No | The query must use covered values; visibility-map state determines whether heap visits can be avoided. 同版本文档
|
| Distance ordering | Not established | Availability depends on the chosen operator class and ordering operator. 所采集来源不足以确认此能力。 |
| Parallel index scan | No | A cooperating scan of one index is distinct from a parallel bitmap heap scan or separate serial scans under Parallel Append. 同版本文档
|
| Parallel index build | Yes | Parallel construction is separate from parallel scans. Worker availability, settings and build phases also matter. 同版本文档
|
存储选项
pages_per_range
Defines the number of table blocks that make up one block range for each entry of a BRIN index (see Section 65.5.1 for more details). The default is 128 .
autosummarize
Defines whether a summarization run is queued for the previous page range whenever an insertion is detected on the next one (see Section 65.5.1.1 for more details). The default is off .
- 有序输出
- 不支持
- 唯一键
- 不支持
- 多键列
- 支持
- INCLUDE 附加列
- 不支持
- 仅索引扫描
- 不支持
- 按距离排序
- 未确定
- 并行索引扫描
- 不支持
- 并行构建索引
- 支持
- evidence kind
- documentation
- runtime verified
- false
- signature
- CREATE INDEX name ON table_name USING brin (column_name);
版本定义 PG 19
brin 索引访问方法。
- 有序输出
否- 唯一键
否- 多键列
是- INCLUDE 列
否- 仅索引扫描
否- 距离排序
未确定- 并行索引扫描
否- 并行索引构建
是
同版本中文手册节选
BRIN 索引(Block Range INdexes 的缩写)存储的是关于表中连续物理块范围内所保存值的摘要信息。因此,它最适用于那些列值与表行物理顺序高度相关的列。与 GiST、SP-GiST 和 GIN 一样,BRIN 也可以支持多种不同的索引策略,而 BRIN 索引可使用哪些具体操作符取决于所采用的索引策略。对于具有线性排序顺序的数据类型,每个块范围上被索引的数据对应于该列值的最小值和最大值。这支持使用下列操作符的索引化查询:
比较版本
完整来源事实
capabilities
map[evidence:[map[anchor:INDEXES-ORDERING file:indexes-ordering.html label:PostgreSQL 19beta4 · indexes-ordering quote:In addition to simply finding the rows to be returned by a query, an index may be able to deliver them in a specific sorted order. This allows a query's ORDER BY specification to be honored without a separate sorting step. Of the index types currently supported by PostgreSQL , only B-tree can produce sorted output — the other index types return matching rows in an unspecified, implementation-dependent order. sha256:d832a6c5a9f9a0a2b933bc14a235b15b50fee8b3e6ba8e4e0ccc5c37d0f217f4 url:/docs/19/indexes-ordering.html#INDEXES-ORDERING]] key:ordered label:Sorted output note:Ordinary sorted output is distinct from ordering by an operator, such as nearest-neighbor distance. state:no value:No], map[evidence:[map[anchor:INDEXES-UNIQUE file:indexes-unique.html label:PostgreSQL 19beta4 · indexes-unique quote:Currently, only B-tree indexes can be declared unique. sha256:bdc4a94b059d5e024e25a6483b04a06881b9e1ea6d3c4dfe26c7e9e53b5fa0cb url:/docs/19/indexes-unique.html#INDEXES-UNIQUE]] key:unique label:Unique keys note:This means a unique index. Exclusion constraints use a different contract. state:no value:No], map[evidence:[map[anchor:INDEXES-MULTICOLUMN file:indexes-multicolumn.html label:PostgreSQL 19beta4 · indexes-multicolumn quote:Currently, only the B-tree, GiST, GIN, and BRIN index types support multiple-key-column indexes. Whether there can be multiple key columns is independent of whether INCLUDE columns can be added to the index. Indexes can have up to 32 columns, including INCLUDE columns. (This limit can be altered when building PostgreSQL ; see the file pg_config_manual.h .) sha256:d88b436c251cab8655ae9ae0ae0e10a90e16c8ae32b95e116735970f22b27c62 url:/docs/19/indexes-multicolumn.html#INDEXES-MULTICOLUMN]] key:multicolumn label:Multiple key columns note:Multiple search keys are distinct from non-key INCLUDE payload columns. state:yes value:Yes], map[evidence:[map[anchor:SQL-CREATEINDEX file:sql-createindex.html label:PostgreSQL 19beta4 · sql-createindex quote:Currently, the B-tree, GiST and SP-GiST index access methods support this feature. In these indexes, the values of columns listed in the INCLUDE clause are included in leaf tuples which correspond to heap tuples, but are not included in upper-level index entries used for tree navigation. sha256:e90c2051c335f6636fb68f3b03f98c3282445c537c99fd7d2e74e4943662e224 url:/docs/19/sql-createindex.html#SQL-CREATEINDEX]] key:include label:INCLUDE columns note:Payload columns do not become search keys. Wide payloads can exceed the index tuple-size limit. state:no value:No], map[evidence:[map[anchor:INDEXES-INDEX-ONLY-SCANS file:indexes-index-only-scans.html label:PostgreSQL 19beta4 · indexes-index-only-scans quote:The index type must support index-only scans. B-tree indexes always do. GiST and SP-GiST indexes support index-only scans for some operator classes but not others. Other index types have no support. The underlying requirement is that the index must physically store, or else be able to reconstruct, the original data value for each index entry. As a counterexample, GIN indexes cannot support index-only scans because each index entry typically holds only part of the original data value. sha256:52fbd3d2f64bb4634c09c57a769c5b231744e4557bb95584f3c8f4ac6886a698 url:/docs/19/indexes-index-only-scans.html#INDEXES-INDEX-ONLY-SCANS]] key:index_only label:Index-only scans note:The query must use covered values; visibility-map state determines whether heap visits can be avoided. state:no value:No], map[evidence:[] key:distance label:Distance ordering note:Availability depends on the chosen operator class and ordering operator. state:unknown value:Not established], map[evidence:[map[anchor:PARALLEL-SCANS file:parallel-plans.html label:PostgreSQL 19beta4 · parallel-plans quote:In a parallel index scan or parallel index-only scan , the cooperating processes take turns reading data from the index. Currently, parallel index scans are supported only for btree indexes. Each process will claim a single index block and will scan and return all tuples referenced by that block; other processes can at the same time be returning tuples from a different index block. The results of a parallel btree scan are returned in sorted order within each worker process. sha256:f99fee3456a48a5ce2c399d6b35ab93183c2c9012e8ed60c53c0c253f79c3756 url:/docs/19/parallel-plans.html#PARALLEL-SCANS]] key:parallel_scan label:Parallel index scan note:A cooperating scan of one index is distinct from a parallel bitmap heap scan or separate serial scans under Parallel Append. state:no value:No], map[evidence:[map[anchor:SQL-CREATEINDEX file:sql-createindex.html label:PostgreSQL 19beta4 · sql-createindex quote:PostgreSQL can build indexes while leveraging multiple CPUs in order to process the table rows faster. This feature is known as parallel index build . For index methods that support building indexes in parallel (currently, B-tree, GIN, and BRIN), maintenance_work_mem specifies the maximum amount of memory that can be used by each index build operation as a whole, regardless of how many worker processes were started. Generally, a cost model automatically determines how many worker processes should be requested, if any. sha256:e90c2051c335f6636fb68f3b03f98c3282445c537c99fd7d2e74e4943662e224 url:/docs/19/sql-createindex.html#SQL-CREATEINDEX]] key:parallel_build label:Parallel index build note:Parallel construction is separate from parallel scans. Worker availability, settings and build phases also matter. state:yes value:Yes]
storage options
map[description:[Defines the number of table blocks that make up one block range for each entry of a BRIN index (see Section 65.5.1 for more details). The default is 128 .] name:pages_per_range source:map[anchor:INDEX-RELOPTION-PAGES-PER-RANGE file:sql-createindex.html label:PostgreSQL 19beta4 · sql-createindex sha256:e90c2051c335f6636fb68f3b03f98c3282445c537c99fd7d2e74e4943662e224 url:/docs/19/sql-createindex.html#INDEX-RELOPTION-PAGES-PER-RANGE] url:/wiki/relopts/brin-pages-per-range/?v=19], map[description:[Defines whether a summarization run is queued for the previous page range whenever an insertion is detected on the next one (see Section 65.5.1.1 for more details). The default is off .] name:autosummarize source:map[anchor:INDEX-RELOPTION-AUTOSUMMARIZE file:sql-createindex.html label:PostgreSQL 19beta4 · sql-createindex sha256:e90c2051c335f6636fb68f3b03f98c3282445c537c99fd7d2e74e4943662e224 url:/docs/19/sql-createindex.html#INDEX-RELOPTION-AUTOSUMMARIZE] url:/wiki/relopts/brin-autosummarize/?v=19]
来源引用
- PostgreSQL 19rc1: BRIN
- PostgreSQL 19rc1 · catalog-pg-am
- PostgreSQL 19rc1 · hash-index
- PostgreSQL 19rc1 · indexam
- PostgreSQL 19rc1 · indexes-index-only-scans
- PostgreSQL 19rc1 · indexes-multicolumn
- PostgreSQL 19rc1 · indexes-opclass
- PostgreSQL 19rc1 · indexes-ordering
- PostgreSQL 19rc1 · indexes-unique
- PostgreSQL 19rc1 · parallel-plans
- PostgreSQL 19rc1 · sql-createindex
定义来源
center · PostgreSQL 19 · 7a2cc9bea1204b31b9707bccdd13a423c966454d88c1fab7530d499d817c76f7
正文语言: zh-Hans · 7a2cc9bea1204b31b9707bccdd13a423c966454d88c1fab7530d499d817c76f7