Re: count() in 9.2

Поиск
Список
Период
Сортировка
От Steve Horn
Тема Re: count() in 9.2
Дата
Msg-id CAFLkBaVEvCXZQPQHQ+qe+AB=HRGvVDxL648jv7tLq1pcJ1ECog@mail.gmail.com
обсуждение исходный текст
Ответ на Re: count() in 9.2  (Thomas Kellerer <spam_eater@gmx.net>)
Ответы Re: count() in 9.2  (Frank Lanitz <frank@frank.uvena.de>)
Список pgsql-novice
Thanks for the replies. I think I need to re-evaluate based on what you are saying. From earlier tests I was finding that Postgres was slow to count records with any WHERE clause. Maybe my perception was incorrect because my samples were not controlled.

Thanks again!

On Wed, Oct 17, 2012 at 2:56 PM, Thomas Kellerer <spam_eater@gmx.net> wrote:
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 the query that is too slow. You might want to read this page: http://wiki.postgresql.org/wiki/SlowQueryQuestions to make sure you include all the needed information when asking such a question.


Thomas





--
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice



--
Steve Horn

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

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: Re: count() in 9.2
Следующее
От: Andrej
Дата:
Сообщение: Re: Beginner's question about ODBC and/or foreign data sources