1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

Measure Bloom index signature-length reloption in bits, not words.

Per discussion, this is a more understandable and future-proof way of
exposing the setting to users.  On-disk, we can still store it in words,
so as to not break on-disk compatibility with beta1.

Along the way, clean up the code associated with Bloom reloptions.
Provide explicit macros for default and maximum lengths rather than
having magic numbers buried in multiple places in the code.  Drop
the adjustBloomOptions() code altogether: it was useless in view of
the fact that reloptions.c already performed default-substitution and
range checking for the options.  Rename a couple of macros and types
for more clarity.

Discussion: <23767.1464926580@sss.pgh.pa.us>
This commit is contained in:
Tom Lane
2016-06-03 10:52:36 -04:00
parent fdfaccfa79
commit ee4af347ba
4 changed files with 86 additions and 93 deletions

View File

@@ -8,8 +8,8 @@
</indexterm>
<para>
<literal>bloom</> is a module which implements an index access method. It comes
as an example of custom access methods and generic WAL records usage. But it
<literal>bloom</> is a module that implements an index access method. It comes
as an example of custom access methods and generic WAL record usage. But it
is also useful in itself.
</para>
@@ -22,8 +22,9 @@
allows fast exclusion of non-candidate tuples via signatures.
Since a signature is a lossy representation of all indexed attributes,
search results must be rechecked using heap information.
The user can specify signature length (in uint16, default is 5) and the
number of bits, which can be set per attribute (1 < colN < 2048).
The user can specify signature length in bits (default 80, maximum 4096)
and the number of bits generated for each index column (default 2,
maximum 4095).
</para>
<para>
@@ -51,17 +52,17 @@
<term><literal>length</></term>
<listitem>
<para>
Length of signature in uint16 type values
Length of signature in bits
</para>
</listitem>
</varlistentry>
</variablelist>
<variablelist>
<varlistentry>
<term><literal>col1 &mdash; col16</></term>
<term><literal>col1 &mdash; col32</></term>
<listitem>
<para>
Number of bits for corresponding column
Number of bits generated for each index column
</para>
</listitem>
</varlistentry>
@@ -77,12 +78,12 @@
<programlisting>
CREATE INDEX bloomidx ON tbloom USING bloom (i1,i2,i3)
WITH (length=5, col1=2, col2=2, col3=4);
WITH (length=80, col1=2, col2=2, col3=4);
</programlisting>
<para>
Here, we created a bloom index with a signature length of 80 bits,
and attributes i1 and i2 mapped to 2 bits, and attribute i3 to 4 bits.
and attributes i1 and i2 mapped to 2 bits, and attribute i3 mapped to 4 bits.
</para>
<para>