BUG #16895: Multicolumn GiST index returns incomplete results

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: dan(dot)barbulescu(at)hollo(dot)software
Subject: BUG #16895: Multicolumn GiST index returns incomplete results
Date: 2021-02-24 11:34:23
Message-ID: 16895-541ff4d9825dcd3c@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 16895
Logged by: Dan Bărbulescu
Email address: dan(dot)barbulescu(at)hollo(dot)software
PostgreSQL version: 13.2
Operating system: Debian GNU/Linux 10 (buster)
Description:

CREATE EXTENSION
IF NOT EXISTS
ltree;

CREATE EXTENSION
IF NOT EXISTS
btree_gist;

CREATE TABLE
test
AS
SELECT
_ ::TEXT ::ltree AS path,
_ ::bit(4) AS flags
FROM
GENERATE_SERIES(1, 1024000) _;

-- A large-ish table is needed, the results don't usually vary by a lot

SELECT
flags,
COUNT(*)
FROM
test
GROUP BY
1
ORDER BY
1;

-- The values are evenly distributed

CREATE INDEX ON
test
USING
gist(path, flags);

-- The "offending" index

SELECT
COUNT(*)
FROM
test
WHERE
flags = '0000';

-- Reindexing sometimes produces different results. This is as much as I've
been able to narrow it down, I haven't been able to reproduce with other
data types (i.e. text instead of ltree) or shorter bit strings.

Browse pgsql-bugs by date

  From Date Subject
Next Message Julien Rouhaud 2021-02-24 12:07:35 Re: BUG #16881: error log:Npgsql.PostgresException (0x80004005): XX001: 无法读取文件"base/16394/25021"的块157:只读取了8192字节的0
Previous Message PG Bug reporting form 2021-02-24 09:42:45 BUG #16894: PANIC: WAL contains references to invalid pages