Patent ID: 8392405

Claim:
A method for performing a cost-based optimization of authorization checks in a database system, the method comprising: receiving an original query at the database system; estimating a total execution cost for the received original query, wherein the total execution cost includes a cost for executing the received original query and an estimated cost for evaluating an access control list; rewriting the received original query by adding: a new predicate with one or more rules from a dynamic access control list, if the access control list is dynamic; or a new predicate with a subquery referencing an index on a table that stores access control lists, if the access control list is static; estimating a cost for executing the rewritten received original query; in response to the estimated cost for executing the rewritten received original query being lower than the estimated total execution cost for the received original query, executing the rewritten received original query; and in response to the estimated cost for executing the rewritten received original query being higher than the estimated total execution cost for the received original query, executing the received original query.