If so then the queries need to look no further than the index itself for the data. This eliminates the queries from having to hit the actual data tables. Indexing small tables can slow down your performance. Stored procedures are prebuilt, precompiled SQL statements that are stored within the database itself. Stored procedures can accept parameters as input and return values as output.
Stored procedures are efficient for many reasons.
First off, stored procedures exist as part of the database itself. Because of this, they are precompiled and prechecked for errors. SQL statements that are going to be used frequently such as table inserts, retrievals, deletions, and updates should be built as a stored procedure. Data validation can be built into stored procedures to ensure that business rules are followed and data integrity is maintained. When executing a stored procedure it is only necessary to pass an execute command.