From: | <postgresql(at)foo(dot)me(dot)uk> |
---|---|
To: | <pgsql-performance(at)postgresql(dot)org> |
Subject: | Re: Slow query: bitmap scan troubles |
Date: | 2012-12-06 14:10:29 |
Message-ID: | 0b9001cdd3bb$760226d0$62067470$@foo.me.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers pgsql-performance |
Hi Jeff
> It kind of does. The expected speed is predicated on the number of rows
being 200 fold higher. If the number of rows actually was that much higher,
the two speeds might be closer together. That is why it would be
interesting to see a more typical case where the actual number of rows is
closer to the 2000 estimate.
Ah, I see of course. Makes a lot of sense when you think about it. This has
been quite an enlightening adventure into the guts of postgres for me :)
> But I am curious about how the cost estimate for the primary key look up
is arrived at:
( Delt with in your next reply, thanks for figuring that out! I will
certainly try the patch)
> I've heard good things about Greg Smith's book, but I don't know if it
covers this particular thing.
A copy is on its way, thank you.
>> We are in the rather pleasant situation here in that we are willing to
>> spend money on the box (up to a point, but quite a large point) to get
>> it up to the spec so that it should hardly ever need to touch the
>> disk, the trick is figuring out how to let our favourite database server
know that.
> Well, that part is fairly easy. Make random_page_cost and seq_page_cost
much smaller than their defaults. Like, 0.04 and 0.03, for example.
Yes, I have been playing a lot with that it makes a lot of difference. When
I tweak them down I end up getting a lot of nested loops instead of hash or
merge joins and they are much faster (presumably we might have gotten a
nested loop out of the planner if it could correctly estimate the low number
of rows returned).
I've got plenty of ammunition now to dig deeper, you guys have been
invaluable.
Cheers,
Phil
From | Date | Subject | |
---|---|---|---|
Next Message | Andres Freund | 2012-12-06 14:12:21 | Re: Commits 8de72b and 5457a1 (COPY FREEZE) |
Previous Message | Simon Riggs | 2012-12-06 14:07:32 | Re: Commits 8de72b and 5457a1 (COPY FREEZE) |
From | Date | Subject | |
---|---|---|---|
Next Message | Jeff Janes | 2012-12-06 17:27:48 | Re: Slow query: bitmap scan troubles |
Previous Message | postgresql | 2012-12-06 12:56:26 | Re: Slow query: bitmap scan troubles |