mysql强制使用指定索引查询
语法:
select * from table_name force index (index_name) where conditions;
使用 关键字 force
#########mysql强制使用指定索引查询 SELECT * FROM `yrd_pay_flow` FORCE INDEX(`idx_trxn_date`) WHERE trxn_date > '2017-08-12 59:59:59' AND trxn_date < '2016-06-23 00:00:00';
SQLServer强制使用指定索引查询
SQL语句范例:Select * From <SQL表格名称> with (NoLock,Index=ix_ByDate) Where BillDate >= '' and BillDate < ''
SQL语句范例:Select * From <SQL表格名称> with (NoLock,Index=ix_ByDate) Where BillDate >= '' and BillDate < ''
注: ix_ByBillDate为此表中根据字段BilLDate建立的字段索引。