Re: WIP: BRIN multi-range indexes
Tomas Vondra <tomas.vondra@2ndquadrant.com>
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>, Andres Freund <andres@anarazel.de>
Cc: Mark Dilger <hornschnorter@gmail.com>,
Alvaro Herrera <alvherre@alvh.no-ip.org>, pgsql-hackers@postgreSQL.org
Date: 2018-03-21T00:07:22Z
Lists: pgsql-hackers
Attachments
- 0001-Pass-all-keys-to-BRIN-consistent-function-a-20180320.patch.gz (application/gzip) patch 0001
- 0002-Move-IS-NOT-NULL-checks-to-bringetbitmap-20180320.patch.gz (application/gzip) patch 0002
- 0003-BRIN-bloom-indexes-20180320.patch.gz (application/gzip) patch 0003
- 0004-BRIN-multi-range-minmax-indexes-20180320.patch.gz (application/gzip) patch 0004
On 03/04/2018 01:14 AM, Tomas Vondra wrote: > ... > > The one overflow issue I found in the patch is that the numeric > "distance" function does this: > > d = DirectFunctionCall2(numeric_sub, a2, a1); /* a2 - a1 */ > > PG_RETURN_FLOAT8(DirectFunctionCall1(numeric_float8, d)); > > which can overflow, of course. But that is not fatal - the index may get > inefficient due to non-optimal merging of ranges, but it will still > return correct results. But I think this can be easily improved by > passing not only the two values, but also minimum and maximum, and use > that to normalize the values to [0,1]. > Attached is an updated patch series, addressing this possible overflow the way I proposed - by computing (a2 - a1) / (b2 - b1), which is guaranteed to produce a value between 0 and 1. The two new arguments are ignored for most "distance" functions, because those can't overflow or underflow in double precision AFAICS. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
BRIN minmax-multi indexes
- ab596105b55f 14.0 landed
-
BRIN bloom indexes
- 77b88cd1bb90 14.0 landed
-
Support the old signature of BRIN consistent function
- a681e3c107aa 14.0 landed
-
Remove unnecessary pg_amproc BRIN minmax entries
- a68dfa27d42f 14.0 landed
-
Optimize allocations in bringetbitmap
- 8e4b332e88b8 14.0 landed
-
Move IS [NOT] NULL handling from BRIN support functions
- 72ccf55cb99c 14.0 landed
-
Pass all scan keys to BRIN consistent function at once
- a1c649d889bd 14.0 landed
-
Properly detoast data in brin_form_tuple
- d2d3a4bd33d2 9.5.24 landed
- bae31e75f777 9.6.20 landed
- 0b96fc977c5b 10.15 landed
- 895d0f0e8218 11.10 landed
- 8149e9f9a0d6 12.5 landed
- 6a7b55f3716f 13.1 landed
- 7577dd84807a 14.0 landed