Re: [HACKERS] Slow count(*) again...

Bruce Momjian <bruce@momjian.us>

From: Bruce Momjian <bruce@momjian.us>
To: Mladen Gogala <mladen.gogala@vmsinfo.com>
Cc: Greg Smith <greg@2ndquadrant.com>, Robert Haas <robertmhaas@gmail.com>, Andrew Dunstan <andrew@dunslane.net>, Tom Lane <tgl@sss.pgh.pa.us>, "david@lang.hm" <david@lang.hm>, Craig Ringer <craig@postnewspapers.com.au>, Vitalii Tymchyshyn <tivv00@gmail.com>, "pgsql-performance@postgresql.org" <pgsql-performance@postgresql.org>
Date: 2011-02-02T21:11:25Z
Lists: pgsql-hackers, pgsql-performance
Mladen Gogala wrote:
> > 2) The sort of random I/O done by index lookups can be as much as 50X as 
> > expensive on standard hard drives as sequential, if every block goes to 
> > physical hardware.
> >   
> 
> Greg, how many questions about queries not using an index have you seen? 
> There is a reason why people keep asking that. The sheer number of 
> questions like that on this group should tell you that there is a 
> problem there. 

Very few of those reports found that an index scan was indeed faster ---
they just assumed so but when they actually tested it, they understood.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +