DNNCommunity / DNNCommunity/Dnn.CommunityForums
Use READ-ONLY SQL Queries for Select Statements
- Dominant language
- C#
- Stars
- 18
- Forks
- 23
- Avg merge
- 20h 30m
- Merged PRs (30d)
- 19
Description
## Is your feature request related to a problem?
When performing database lookups, they can be expensive in terms of performance on larger websites. In the case of display views, there's no reason to have the full power that comes with a default query.
This proposed update suggests updating all `SELECT` queries to use a read-only context. This will reduce the load on the query itself and the SQL database overall.
## Describe the solution you'd like
An elegant solution can be seen [in the most recent release of Hotcakes Commerce](https://github.com/HotcakesCommerce/hotcakes-commerce-core/pull/392).
It uses EF, but another way to do this could be to isolate the `SELECT` statements, and append `;ApplicationIntent=ReadOnly;` to the end of the connection string before executing the `SELECT`.
## Describe alternatives you've considered
None yet.
## Additional context
N/A
Contributor guide
Assessment
This issue has not been assessed yet.