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
обсуждение исходный текст
Ответ на RE: BUG #16031: Group by returns duplicate groups  (David Raymond <David.Raymond@tomtom.com>)
Ответы Re: BUG #16031: Group by returns duplicate groups  (Peter Geoghegan <pg@bowt.ie>)
Re: BUG #16031: Group by returns duplicate groups  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Список pgsql-bugs
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
Дата:
Сообщение: RE: BUG #16031: Group by returns duplicate groups
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: BUG #16031: Group by returns duplicate groups