Re: API change advice: Passing plan invalidation info from the rewriter into the planner? - Mailing list pgsql-hackers

From Adam Brightwell
Subject Re: API change advice: Passing plan invalidation info from the rewriter into the planner?
Date
Msg-id CAC+8xRLUi33F7Rmo6BNMkxUb1UPeuzt+UtEpvbXPZdgG79HDCg@mail.gmail.com
Whole thread Raw
In response to Re: API change advice: Passing plan invalidation info from the rewriter into the planner?  (Stephen Frost <sfrost@snowman.net>)
Responses Re: API change advice: Passing plan invalidation info from the rewriter into the planner?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi all,

This is my first post to the mailing list and I am looking forward to working with everyone in the community.

With that said...

I'll take a look at changing the cache key to include user ID and
ripping out the plan invalidation logic from the current patch tomorrow
but I seriously doubt I'll be able to get all of that done in the next
day or two.  If anyone else is able to help out, it'd certainly be
appreciated; I really think that's the main hurdle to address at this
point with this patch- without the plan invalidation complexity, the
the patch is really just building out the catalog, the SQL-level
statements for managing it, and the bit of code required to add the
conditional to statements involving RLS-enabled tables.

I have been collaborating with Stephen on addressing this particular item with RLS.

As a basis, I have been working with Craig's 'rls-9.4-upd-sb-views' branch rebased against master around 9.4beta1.

Through this effort, we have concluded that for RLS the case of invalidating a plan is only necessary when switching between a superuser and a non-superuser.  Obviously, re-planning on every role change would be too costly, but this approach should help minimize that cost.  As well, there were not any cases outside of this one that were immediately apparent with respect to RLS that would require re-planning on a per userid basis.

I have tested this approach with the following patch.


Does this sound like a sane approach?  Thoughts?  Recommendations?

Thanks,
Adam

pgsql-hackers by date:

Previous
From: Jeff Janes
Date:
Subject: Re: Re: why postgresql define NTUP_PER_BUCKET as 10, not other numbers smaller
Next
From: Tom Lane
Date:
Subject: Re: Getting “make: Entering an iso-8859-1 directory” error while building postgresql on MIPS platform