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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Greg Smith wrote:
> Mladen Gogala wrote:
> > 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. There must be a relatively simple way of influencing 
> > optimizer decisions. 
> 
> I think that's not quite the right question.  For every person like 
> yourself who is making an informed "the optimizer is really picking the 
> wrong index" request, I think there are more who are asking for that but 
> are not actually right that it will help.  I think you would agree that 
> this area is hard to understand, and easy to make mistakes about, yes?  
> So the right question is "how many questions about queries not using an 
> index would have actually benefitted from the behavior they asked for?"  
> That's a much fuzzier and harder to answer question.

Agreed.  I created an FAQ entry years ago to explain this point and tell
people how to test it:

	http://wiki.postgresql.org/wiki/FAQ#Why_are_my_queries_slow.3F_Why_don.27t_they_use_my_indexes.3F

Once I added that FAQ we had many fewer email questions about index
choice.

> > With all due respect, I consider myself smarter than the optimizer.  
> > I'm 6'4", 235LBS so telling me that you disagree and that I am more 
> > stupid than a computer program,  would not be a smart thing to do. 
> > Please, do not misunderestimate me.
> 
> I remember when I used to only weigh that much.  You are lucky to be 
> such a slim little guy!
> 
> Oh, I guess I should add, :)

Oh, wow, what a great retort.  :-)

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

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

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


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux