MySQL Stored Procedure vs. complex query

前端 未结 5 735
迷失自我
迷失自我 2020-12-01 14:33

How is the performance of a Stored Procedure? Is it worth using them instead of implementing a complex query in a PHP/MySQL call?

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-01 14:56

    Stored procedures will give you a small performance boost, but mostly they are for doing tasks that are difficult or impossible to do with a simple query. Stored procedures are great for simplifying access to data for many different types of clients. Database administrators love them because they control how the database is used as opposed to leaving those details to the developer.

    Look to indexes and proper table design to get better performance.

提交回复
热议问题