Home | Mirror | Search

2. SQL

where 條件的順序影響查詢速度

EXPLAIN select *,from_unixtime(sendtime) from sms where id='461539' and content like '13%';
/* 0 rows affected, 1 rows found. Duration for 1 query: 0.218 sec. */

EXPLAIN select *,from_unixtime(sendtime) from sms where content like '13%' and id='461539';
/* 0 rows affected, 1 rows found. Duration for 1 query: 0.717 sec. */
		
comments powered by Disqus