Re: count(*) and bad design was: Experiences with extensibility

Поиск
Список
Период
Сортировка
Искать
От
Sim Zacks
Тема
Re: count(*) and bad design was: Experiences with extensibility
Дата
Msg-id
fm2m51$kt9$1@news.hub.org
Ответ на
Список
Дерево обсуждения
Re: count(*) and bad design was: Experiences with extensibility Harald Fuchs <hf0217x@protecting.net>
Re: count(*) and bad design was: Experiences with extensibility Alvaro Herrera <alvherre@commandprompt.com>
Using count(*) is not bad design, though generally it makes sense to use it with 
a where.

Saying using count(*) is bad design means that the only design that you can 
visualize is the specific one that you are using.

There are tons of real world examples where you need count. That is why so many 
people use it as a benchmark.

Obviously if you have an application where millions of rows are added and 
subtracted every minute, then the value of count is kind of vague.

However, if you are querying a data warehouse that gets populated once a month, 
then count has a huge value. You could use statistics in that case, but it is 
much harder to join against other tables when you are using statistics. It is 
also less intuitive then using the SQL standard for finding the number of rows.

Sim
В списке pgsql-general по дате отправления
От: Alvaro Herrera
Дата:
От: Josh Harrison
Дата:
FAQ