Forum Discussion
Row-Level Security (RLS) with INLINE or SCHEMABINDING
- 8 months ago
Yes — the function used for the RLS predicate should be INLINE.
That’s the expected type of function for RLS because it lets the engine fold the predicate directly into the query plan.SCHEMABINDING is just an additional option you apply on top of the inline function when you want stability and to prevent accidental schema changes.
So the correct combination is:
INLINE TVF → required
SCHEMABINDING → recommended/commonly used
Did I answer your question? Mark my post as a solution!
GopiKrishna
so for the question above, we should put INLINE, correct?
Yes — the function used for the RLS predicate should be INLINE.
That’s the expected type of function for RLS because it lets the engine fold the predicate directly into the query plan.
SCHEMABINDING is just an additional option you apply on top of the inline function when you want stability and to prevent accidental schema changes.
So the correct combination is:
INLINE TVF → required
SCHEMABINDING → recommended/commonly used
Did I answer your question? Mark my post as a solution!
GopiKrishna