Postgres not using correct indices for views.

From: "Thomas Rosenstein" <thomas(dot)rosenstein(at)creamfinance(dot)com>
To: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Postgres not using correct indices for views.
Date: 2019-08-08 12:02:52
Message-ID: EC37F8FB-D294-409A-97CC-72C7A5A6CE42@creamfinance.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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 18 sec (it does a full table scan, or uses the wrong
indices).

Do we have to GRANT additional rights? I see it's using some indices,
just not the correct ones!

Has anyone experienced the same issues? What can we do about that?

Thanks
BR
Thomas

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2019-08-08 16:05:12 Re: Postgres not using correct indices for views.
Previous Message Andreas Kretschmer 2019-08-05 21:15:36 Re: improving windows functions performance