Re: Performance of count(*)

От: Andreas Tille
Тема: Re: Performance of count(*)
Дата: ,
Msg-id: Pine.LNX.4.62.0703221239570.13747@wr-linux02
(см: обсуждение, исходный текст)
Ответ на: Re: Performance of count(*)  (Andreas Kostyrka)
Ответы: Re: Performance of count(*)  (Andreas Kostyrka)
Re: Performance of count(*)  ("Luke Lonergan")
Список: pgsql-performance

Скрыть дерево обсуждения

Performance of count(*)  (Andreas Tille, )
 Re: Performance of count(*)  (Andreas Kostyrka, )
  Re: Performance of count(*)  (Andreas Tille, )
   Re: Performance of count(*)  (Andreas Kostyrka, )
    Re: Performance of count(*)  (Michael Fuhr, )
    Re: Performance of count(*)  (Carlos Moreno, )
   Re: Performance of count(*)  ("Luke Lonergan", )
 Re: Performance of count(*)  (Albert Cervera Areny, )
  Re: Performance of count(*)  (, )
   Re: Performance of count(*)  (Bill Moran, )
   Re: Performance of count(*)  (Mario Weilguni, )
   Re: Performance of count(*)  (Michael Stone, )
    Re: Performance of count(*)  (, )
    Re: Performance of count(*)  ("Craig A. James", )
     Re: Performance of count(*)  (Tino Wildenhain, )
      Re: Performance of count(*)  ("Craig A. James", )
       Re: Performance of count(*)  (Tino Wildenhain, )
        Re: Performance of count(*)  (Michael Stone, )
         Re: Performance of count(*)  ("Merlin Moncure", )
          Re: Performance of count(*)  (Michael Stone, )
          Re: Performance of count(*)  (Tino Wildenhain, )
          Re: Performance of count(*)  (Michael Stone, )
          Re: Performance of count(*)  (Michael Stone, )
         Re: Performance of count(*)  (Tino Wildenhain, )
          Re: Performance of count(*)  (Michael Stone, )
           Re: Performance of count(*)  (Tino Wildenhain, )
        Re: Performance of count(*)  ("Craig A. James", )
         Re: Performance of count(*)  (Tino Wildenhain, )
       Re: Performance of count(*)  (Steve Atkins, )
        Re: Performance of count(*)  ("Craig A. James", )
         Re: Performance of count(*)  (Tom Lane, )
          Re: Performance of count(*)  ("Craig A. James", )
           Re: Performance of count(*)  (Tom Lane, )
        Re: Performance of count(*)  (Guido Neitzer, )
         Re: Performance of count(*)  (Steve Atkins, )
     Re: Performance of count(*)  (Brian Hurt, )
      Re: Performance of count(*)  ("Craig A. James", )
 Re: Performance of count(*)  (, )
 Re: Performance of count(*)  ("Merlin Moncure", )
  Re: Performance of count(*)  ("Jonah H. Harris", )
   Re: Performance of count(*)  (Mario Weilguni, )
    Re: Performance of count(*)  (Andreas Kostyrka, )
     Re: Performance of count(*)  (Mario Weilguni, )
  Re: Performance of count(*)  (Michael Stone, )

On Thu, 22 Mar 2007, Andreas Kostyrka wrote:

> Which version of PG?

Ahh, sorry, forgot that.  The issue occurs in Debian (Etch) packaged
version 7.4.16.  I plan to switch soon to 8.1.8.

> That's the reason why PG (check the newest releases, I seem to
> remember that there has been some aggregate optimizations there),

I'll verify this once I moved to the new version.

> does
> a SeqScan for select count(*) from table. btw, depending upon your
> data, doing a select count(*) from table where user=X will use an
> Index, but will still need to fetch the rows proper to validate them.

I have an index on three (out of 7 columns) of this table.  Is there
any chance to optimize indexing regarding this.

Well, to be honest I'm not really interested in the performance of
count(*).  I was just discussing general performance issues on the
phone line and when my colleague asked me about the size of the
database he just wonderd why this takes so long for a job his
MS-SQL server is much faster.  So in principle I was just asking
a first question that is easy to ask.  Perhaps I come up with
more difficult optimisation questions.

Kind regards

         Andreas.

--
http://fam-tille.de


В списке pgsql-performance по дате сообщения:

От: "Craig A. James"
Дата:
Сообщение: Re: Performance of count(*)
От: Steve Atkins
Дата:
Сообщение: Re: Performance of count(*)