Re: Postgres not using correct indices for views.

2019-08-09 Thread Tom Lane
[ re-adding list ] "Thomas Rosenstein" writes: > On 9 Aug 2019, at 0:45, Tom Lane wrote: >> However ... it sort of looks like the planner didn't even consider >> the second plan shape in the "wrong" case. If it had, then even >> if it costed it 3X more than it did in the "right" case, the second

Re: Bitmap heap scan performance

2019-08-09 Thread Jeff Janes
On Fri, Aug 9, 2019 at 4:42 AM Rob Emery wrote: > > It > seems to me like the Bitmap Heap Scan on proposal is the issue because > the recheck is throwing away enormous amounts of data. Have you tried increasing work_mem? The probable reason for the recheck is that your bitmap overflows the al

Bitmap heap scan performance

2019-08-09 Thread Rob Emery
Hi Guys, I’m at a bit of a loss where I can go with the following 2 queries that are over the same data structure (DDL attached) under postgresql PostgreSQL 9.5.16 on x86_64-pc-linux-gnu (Debian 9.5.16-1.pgdg90+1), compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit and could do with a