Parameterized Offset/Fetch makes query slower
- Dominant language
- C#
- Stars
- 14.8k
- Forks
- 3.4k
- PR merge metrics
- PR metrics pending
Description
## scenario
Recently I created an column store index to improve the performance. It was fine if I directly specify the input of Offset/Fetch. However, I found that when I executed the sql generated by EF which is parameterized, the performance got almost 10 times slower than the former. It could be a disaster if there are extra entities to join.
I wonder if there is an solution for my scenario or maybe is that an opportunity for EF? The Skip()/Take() only accept the int parameter, so I guess it is relatively safe and might be unnecessary to parameterize the input for Offset/Fetch.
## samples
**Parameterized Offset/Fetch with 1 row**


**Non-parameterized Offset/Fetch with 1 row**


**Non-parameterized Offset/Fetch with 900 row**


## version information
EF Core version: 3.1
Database provider: SQL Server in Azure
Contributor guide
Assessment
This issue has not been assessed yet.