Re: [HACKERS] No: implied sort with group by

Поиск
Список
Период
Сортировка
От darrenk@insightdist.com (Darren King)
Тема Re: [HACKERS] No: implied sort with group by
Дата
Msg-id 9801291337.AA55410@ceodev
обсуждение исходный текст
Ответы Re: [HACKERS] No: implied sort with group by  (Bruce Momjian <maillist@candle.pha.pa.us>)
Список pgsql-hackers
> > > > postgres=> select b,c,sum(a) from t1 group by b,c;
> > > > b|c|sum
> > > > -+-+---
> > > >  |x|  5
> > > >  |z|  3
> > > >  |x|  0
> > > > (3 rows)
> > > >
> > > > postgres=> select * from t1;
> > > > a|b|c
> > > > -+-+-
> > > > 1| |x
> > > > 2| |x
> > > > 2| |x
> > > > 3| |z
> > > > 0| |x
> > > > (5 rows)
> > > >
> > > ...
> >
> And in v6.1. If b is a space (rather than a NULL), then the behaviour is correct
> so it must be a problem in grouping NULLs.
>

explain select b,c,sum(a) from foo group by b,c; -- gives...

Aggregate  (cost=0.00 size=0 width=0)
  ->   Group  (cost=0.00 size=0 width=0)
    ->     Sort  (cost=0.00 size=0 width=0)
      ->       Seq Scan on foo  (cost=0.00 size=0 width=28)

There sort is there before the grouping operation, so this would seem to point to
the sort code incorrectly setting something when handling NULLs.

This doesn't seem like the same bug that Vadim found since a small data set such as
this one _shouldn't_ be going out to a tape file.

darrenk

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] time stamps in logging
Следующее
От: Andrew Martin
Дата:
Сообщение: Re: [HACKERS] postmaster crash and .s.pgsql file