Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What to grant to user to use index of table while querying?

I want to know if oracle uses index when user queries data from table and that user has been granted just:
grant select on table to user

I want to know if it is needed some another grant to use index.

like image 675
Zango Avatar asked Aug 09 '10 11:08

Zango


People also ask

How do I grant an index privilege to user in Oracle?

If you want to create a index to a table in another schema first you need to grant the system privilege to the user you want use to create de index. To create an index in another schema, you must have the CREATE ANY INDEX system privilege. Show activity on this post. begin table_owner.

Why index is not used in query?

The reason the non-clustered index is not used is because it is more efficient to select the single row using the unique primary key clustered index. You can't get any faster than that to select all columns for a single row (barring a hash index on an in-memory table).

How does Oracle decide which index to use?

Oracle uses the sort space in memory allocated for the creator of the index (the amount for each user is determined by the initialization parameter SORT_AREA_SIZE ), but must also swap sort information to and from temporary segments allocated on behalf of the index creation.


1 Answers

No, there is no requirement (or ability) to grant access to an index. If the user can access the table then their queries can use any available index.

like image 121
Tony Andrews Avatar answered Sep 26 '22 03:09

Tony Andrews