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

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Greg Smith <greg(at)2ndquadrant(dot)com>
Cc: Mladen Gogala <mladen(dot)gogala(at)vmsinfo(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "david(at)lang(dot)hm" <david(at)lang(dot)hm>, Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>, Vitalii Tymchyshyn <tivv00(at)gmail(dot)com>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: [HACKERS] Slow count(*) again...
Date: 2011-02-03 00:13:44
Message-ID: 201102030013.p130DiH08690@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

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(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pitts 2011-02-03 00:29:20 Re: [HACKERS] Slow count(*) again...
Previous Message Greg Smith 2011-02-03 00:03:06 Re: [HACKERS] Slow count(*) again...

Browse pgsql-performance by date

  From Date Subject
Next Message Greg Smith 2011-02-03 00:17:05 Re: [HACKERS] Slow count(*) again...
Previous Message Greg Smith 2011-02-03 00:03:06 Re: [HACKERS] Slow count(*) again...