Re: Postgres not using correct indices for views.

2019-08-10 Thread Thomas Rosenstein
[ 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 &quo

Re: Postgres not using correct indices for views.

2019-08-08 Thread Thomas Rosenstein
To add additional info, the same behaviour is exhibited with the owner, and the user which only has read priviledges on the view! On 8 Aug 2019, at 22:04, Thomas Rosenstein wrote: Hi, I'm upgraded to 10.10 from today (on the replicated instance - main db is still 10.5), but still hav

Re: Postgres not using correct indices for views.

2019-08-08 Thread Thomas Rosenstein
Filter: ((date - '3 days'::interval day) <= loans.duedate) ``` Thanks Thomas On 8 Aug 2019, at 18:05, Tom Lane wrote: "Thomas Rosenstein" writes: we have created restricted view for our tables, so that we can allow access to non-gdpr relevant data but h

Postgres not using correct indices for views.

2019-08-08 Thread Thomas Rosenstein
Hi, we have created restricted view for our tables, so that we can allow access to non-gdpr relevant data but hide everything else. For exactly those views, the Query Planner uses the wrong indices, when executing exactly the same query, once it takes 0.1 s and on the views it takes nearly 1