Re: count() in 9.2

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: count() in 9.2
Дата
Msg-id k5mv09$fvk$1@ger.gmane.org
обсуждение исходный текст
Ответ на Re: count() in 9.2  (Steve Horn <steve@stevehorn.cc>)
Ответы Re: count() in 9.2  (Steve Horn <steve@stevehorn.cc>)
Список pgsql-novice
Steve Horn wrote on 17.10.2012 20:41:
> If our application could not do a count quickly there is no reason to
> show up for work. Our application provides counts of lists to
> customers who then use that information to purchase records of data
> from our lists. There are on average 80 columns that the user can
> apply "WHERE, AND, or OR" to narrow their count (list).
>
> We are using Microsoft Sql Server currently. It provides counts in an
> acceptable amount of time with 160 million+ rowcount tables with
> dozens of AND clauses applied.
>

Now that is something completely different than what the wiki page regarding "Slow counting" talks about.

That page is *only* about counting *all* rows in a table, so a "select count(*) from foobar" without any where
condition.
I'm pretty sure SQL Server won't be that much faster calculating the total row count of a table than PostgreSQL.

When you talk about "dozens of AND clauses" then this is a completely different problem.
It can be fast in PostgreSQL as well provided you do have proper indexing applied.


If you have a problem with that, I'm sure this list can help you tune the query according to your needs if you show us
thequery that is too slow. You might want to read this page: http://wiki.postgresql.org/wiki/SlowQueryQuestions to make
sureyou include all the needed information when asking such a question. 


Thomas


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

Предыдущее
От: Steve Horn
Дата:
Сообщение: Re: count() in 9.2
Следующее
От: Steve Horn
Дата:
Сообщение: Re: count() in 9.2