[Solved] If to put a dummy condition in sql query like between \'mindate\' and \'maxdate\', would efficiency of query be reduced?
EverSQL Database Performance Knowledge Base
If to put a dummy condition in sql query like between \'mindate\' and \'maxdate\', would efficiency of query be reduced?
In SQL Server 2008,
select * from OneTable
select * from OneTable where OneTable.SomeDate between 'MINDATE' and 'MAXDATE'
which one is fast or they are same fast?
How to optimize this SQL query?
The following recommendations will help you in your SQL tuning process. You'll find 3 sections below:
Description of the steps you can take to speed up the query.
The optimal indexes for this query, which you can copy and create in your database.
An automatically re-written query you can copy and execute in your database.
The optimization process and recommendations:
Avoid Selecting Unnecessary Columns (query line: 2): Avoid selecting all columns with the '*' wildcard, unless you intend to use them all. Selecting redundant columns may result in unnecessary performance degradation.