Re: [HACKERS] too low cost of Bitmap index scan

2016-12-20 Thread Pavel Stehule
2016-12-21 0:01 GMT+01:00 Tom Lane : > Pavel Stehule 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

Re: [HACKERS] too low cost of Bitmap index scan

2016-12-20 Thread Tom Lane
Pavel Stehule 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

Re: [HACKERS] too low cost of Bitmap index scan

2016-12-20 Thread Pavel Stehule
2016-12-20 13:55 GMT+01:00 Robert Haas : > On Tue, Dec 20, 2016 at 2:13 AM, Pavel Stehule > wrote: > > 2016-12-19 23:28 GMT+01:00 Robert Haas : > >> On Sat, Dec 17, 2016 at 3:30 AM, Pavel Stehule >

Re: [HACKERS] too low cost of Bitmap index scan

2016-12-20 Thread Robert Haas
On Tue, Dec 20, 2016 at 2:13 AM, Pavel Stehule wrote: > 2016-12-19 23:28 GMT+01:00 Robert Haas : >> On Sat, Dec 17, 2016 at 3:30 AM, Pavel Stehule >> wrote: >> > -> Bitmap Heap Scan on "Zasilka" (cost=5097.39..5670.64

Re: [HACKERS] too low cost of Bitmap index scan

2016-12-19 Thread Pavel Stehule
2016-12-19 23:28 GMT+01:00 Robert Haas : > On Sat, Dec 17, 2016 at 3:30 AM, Pavel Stehule > wrote: > > -> Bitmap Heap Scan on "Zasilka" (cost=5097.39..5670.64 rows=1 > width=12) > > (actual time=62.253..62.400 rows=3 loops=231) > ... > > When I

Re: [HACKERS] too low cost of Bitmap index scan

2016-12-19 Thread Robert Haas
On Sat, Dec 17, 2016 at 3:30 AM, Pavel Stehule wrote: > -> Bitmap Heap Scan on "Zasilka" (cost=5097.39..5670.64 rows=1 width=12) > (actual time=62.253..62.400 rows=3 loops=231) ... > When I disable bitmap scan, then the query is 6x time faster >-> Index Scan

[HACKERS] too low cost of Bitmap index scan

2016-12-17 Thread Pavel Stehule
Hi I am trying to fix slow query on PostgreSQL 9.5.4. The data are almost in RAM I have a problem with too low cost slow Bitmap index scan on date column, that returns 300K rows. Slow part -> Bitmap Heap Scan on "Zasilka" (cost=5097.39..5670.64 rows=1 width=12) (actual time=62.253..62.400