Re: too low cost of Bitmap index scan

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: too low cost of Bitmap index scan
Date: 2016-12-21 06:59:38
Message-ID: CAFj8pRCzra4y=ysQi3LPWnfDK=BYXQ_AxyH-rWTFwM3DbBH22w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2016-12-21 0:01 GMT+01:00 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:

> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> > I am trying to fix slow query on PostgreSQL 9.5.4.
> > The data are almost in RAM
>
> If it's all in RAM, you'd likely be well-served to lower random_page_cost.
> It looks to me like the planner is estimating pretty accurately how many
> heap fetches will be eliminated by using the extra index; where it's off
> seems to be in the cost of those heap fetches relative to the index work.
>

When I decrease random page cost, then the cost of bitmapscan was decreased
too

https://explain.depesz.com/s/7CAJ .. random page cost 2
https://explain.depesz.com/s/iEBW .. random page cost 2, bitmapscan off
https://explain.depesz.com/s/W4zw .. random page cost 2
https://explain.depesz.com/s/Gar .. random page cost 1, bitmapscan off

I played with other costs, but without any success, the cost of bitmapscan
is significantly cheaper then index scan.

Regards

Pavel

> regards, tom lane
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2016-12-21 07:14:12 Re: pgsql: Simplify LWLock tranche machinery by removing array_base/array_s
Previous Message Petr Jelinek 2016-12-21 06:47:45 Re: Logical decoding on standby