RE: BUG #16031: Group by returns duplicate groups

Поиск
Список
Период
Сортировка
Искать
От
David Raymond
Тема
RE: BUG #16031: Group by returns duplicate groups
Дата
Msg-id
VI1PR07MB6029CF9430ECED44CB457E3B87820@VI1PR07MB6029.eurprd07.prod.outlook.com
Ответ на
Список
Дерево обсуждения
BUG #16031: Group by returns duplicate groups PG Bug reporting form <noreply@postgresql.org>
Re: BUG #16031: Group by returns duplicate groups Tom Lane <tgl@sss.pgh.pa.us>
RE: BUG #16031: Group by returns duplicate groups David Raymond <David.Raymond@tomtom.com>
RE: BUG #16031: Group by returns duplicate groups David Raymond <David.Raymond@tomtom.com>
Re: BUG #16031: Group by returns duplicate groups Andrew Gierth <andrew@tao11.riddles.org.uk>
RE: BUG #16031: Group by returns duplicate groups David Raymond <David.Raymond@tomtom.com>
Re: BUG #16031: Group by returns duplicate groups Andrew Gierth <andrew@tao11.riddles.org.uk>
RE: BUG #16031: Group by returns duplicate groups David Raymond <David.Raymond@tomtom.com>
RE: BUG #16031: Group by returns duplicate groups David Raymond <David.Raymond@tomtom.com>
Re: BUG #16031: Group by returns duplicate groups Andrew Gierth <andrew@tao11.riddles.org.uk>
RE: BUG #16031: Group by returns duplicate groups David Raymond <David.Raymond@tomtom.com>
Re: BUG #16031: Group by returns duplicate groups Andrew Gierth <andrew@tao11.riddles.org.uk>
RE: BUG #16031: Group by returns duplicate groups David Raymond <David.Raymond@tomtom.com>
Re: BUG #16031: Group by returns duplicate groups Tomas Vondra <tomas.vondra@2ndquadrant.com>
RE: BUG #16031: Group by returns duplicate groups David Raymond <David.Raymond@tomtom.com>
Re: BUG #16031: Group by returns duplicate groups Andrew Gierth <andrew@tao11.riddles.org.uk>
Re: BUG #16031: Group by returns duplicate groups Peter Geoghegan <pg@bowt.ie>
RE: BUG #16031: Group by returns duplicate groups David Raymond <David.Raymond@tomtom.com>
Re: BUG #16031: Group by returns duplicate groups Andrew Gierth <andrew@tao11.riddles.org.uk>
Looking possibly like indexing is part of the issue at the moment.

When I added an array_agg(id_1) in the group by, one of the 'DK' groups had 9, one had 16.

I wrote a script to scan the text dump and counted 25 records with the "name" field value of 'DK'

After the restore which includes the indexes, "count(*) from big_table where name = 'DK';" uses the index which starts with "name" and returns 9.
Dropping that index and running it again returns 25.

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.

Will get back to this sometime tomorrow as my brain has now melted.
В списке pgsql-bugs по дате отправления
От: David Raymond
Дата:
От: Peter Geoghegan
Дата:
FAQ