• Along with the requests for information, learn about indexes. We can't just say index col1 or col2. Indexing needs to be balanced across your workload. If there are thousands (lac) of records, then you'll need to consider the various queries and their needs.

    In general, you want to index the primary and foreign key fields, along with the fields that are included in the WHERE clause, BUT ...

    you want to limit to 5-7 indexes on these tables if they change often.

    Also, why remove the procedure? It's easier to fix/tune/update over time than a query embedded in your application.