Re: BUG #16031: Group by returns duplicate groups - Mailing list pgsql-bugs

From Peter Geoghegan
Subject Re: BUG #16031: Group by returns duplicate groups
Date
Msg-id CAH2-Wzk+e_XeffEyLPQeHUMzot1KV5Y4TCJu+AGCQtZshLf17Q@mail.gmail.com
Whole thread Raw
In response to RE: BUG #16031: Group by returns duplicate groups  (David Raymond <David.Raymond@tomtom.com>)
Responses RE: BUG #16031: Group by returns duplicate groups
List pgsql-bugs
On Mon, Sep 30, 2019 at 2:49 PM David Raymond <David.Raymond@tomtom.com> wrote:
> I re-created the index...
> create index on big_table (name, id_1, id_2);
>
> ...and count(*) goes back to returning 9 again.
>
> and group by sees those 9 as one group and the other 16 as a different group.

You should try running contrib/amcheck, which should be able to confirm
index corruption, and give you a specific complaint. You may then be
able to inspect the exact index page with the problem using
contrib/pageinspect. Something like this ought to do it on Postgres
11:

CREATE EXTENSION IF NOT EXISTS amcheck
SELECT bt_index_check('my_index', true);

If that doesn't show any errors, then perhaps try this:

SELECT bt_index_parent_check('my_index', true);

Let us know what you see.

--
Peter Geoghegan



pgsql-bugs by date:

Previous
From: David Raymond
Date:
Subject: RE: BUG #16031: Group by returns duplicate groups
Next
From: Andrew Gierth
Date:
Subject: Re: BUG #16031: Group by returns duplicate groups