a change of query

Поиск
Список
Период
Сортировка
От James Cooper
Тема a change of query
Дата
Msg-id 004a01c2dd19$be6fe400$c900a8c0@jax
обсуждение исходный текст
Ответы Re: a change of query  (Brad Hilton <bhilton@vpop.net>)
Re: a change of query  (Rod Taylor <rbt@rbt.ca>)
Список pgsql-sql

select distinct cp.person_id from cluster_person cp, cluster c where cp.cluster_id = c.cluster_id and c.c_id = 1

can this query be changed to give just the row count?( of the distinct rows )

yes: i am aware of count() but this wont count the distinct rows - I can however achive this with an nested person_id in(select... etc but that slows things down big time!!!!

the above quey gives me my resultset asap - is there a way to get just the number of rows with the same speed

My thoughts are that I could just make a plpgsql  function with a GET Diagniostics ROW_COUNT -

thoughts?

 

James

 

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Return type of triger functions from OPAQUE to TRIGGER in 7.3
Следующее
От: Brad Hilton
Дата:
Сообщение: Re: a change of query