If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > WHERE clause optimization

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-03-06, 00:21
screenmates screenmates is offline
Registered User
 
Join Date: Jul 2005
Posts: 63
WHERE clause optimization

If the column used in the where clause is indexed, which one of the following is more ideal so it uses the index optimally:

1. WHERE Status != 0

EXPLAIN RESULTS:
select_type: SIMPLE
type: range
possible_keys: PRIMARY
key: PRIMARY
key_len: 1
ref: null
rows: 3
Extra: Using where


2. WHERE Status > 0

EXPLAIN RESULTS:
The only difference from the above results is:
rows: 2

but I do not know what rows stand for.

Thanks,

Last edited by screenmates; 03-03-06 at 00:29.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On