Re: Problem query

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: Problem query
Дата
Msg-id 4DE768E9020000250003E002@gw.wicourts.gov
обсуждение исходный текст
Ответ на Problem query  (CS DBA <cs_dba@consistentstate.com>)
Ответы Re: Problem query  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Список pgsql-performance
Shaun Thomas <sthomas@peak6.com> wrote:

> You're counting the number of maximum values in your table for
> tds_cx_ind and cxs_ind_2, but there will always be at least one
> for every combination.

Good point.

> What you really want is this:
>
> SELECT count(1) FROM (
>    SELECT DISTINCT tds_cx_ind, cxs_ind_2
>      FROM max_xtrv_st_t
> );

Or maybe:

SELECT count(DISTINCT (tds_cx_ind, cxs_ind_2)) FROM max_xtrv_st_t;

-Kevin

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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Understanding Hash Join performance
Следующее
От: Shaun Thomas
Дата:
Сообщение: Re: Problem query