Septanet Forum  

Go Back   Septanet Forum > Computers, Software, Harware, Information Technology > MySQL

Reply
 
LinkBack Thread Tools Display Modes
Old 05-08-2011, 03:22 PM   #1
Senior Member
 
harry's Avatar
 
Join Date: Aug 2011
Posts: 103
Default Little information about index but very imnportant hope u will enjoy it

when we created the table and defined the index how many time we think about that mysql take the advantage of that index or not

Example: CREATE TABLE test (id INT,
name VARCHAR(100)

and defined the index on name (alter table test add index 'name')

and in programming code we had written query select * from test where name like '%%' query providing the output which parameter we are passing in it.

so can mysql take the benefit of that index if you are saying yes then you are wrong

REASON: BCZ mysql use many wild card and we have not idea which wild card we have to choose, in above example we have choose '%%' wildcard this wildcard is the limitation of indexing if you have defined the index and find the index field with above wildcard then all row will be scanned rather then some specific rows

SOLUTION: So use the post fix wildcard('%')instead of prefix,full text for those fields in which we had defined the index then we can take the benefit of that index otherwise that index nothing for mysql and for us

I believe in practical so do the practice against and enjoy it
harry is offline  
Digg this Post!Bookmark Post in Technorati
Reply With Quote
Old 25-08-2011, 10:48 AM   #2
Senior Member
 
sharma.s.prakash's Avatar
 
Join Date: Aug 2011
Posts: 110
Smile

thanks for sharing this information
sharma.s.prakash is offline  
Digg this Post!Bookmark Post in Technorati
Reply With Quote
Old 25-08-2011, 12:13 PM   #3
Senior Member
 
harry's Avatar
 
Join Date: Aug 2011
Posts: 103
Default

pls implement it in your program also
harry is offline  
Digg this Post!Bookmark Post in Technorati
Reply With Quote
Reply

Thread Tools
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +5.5. The time now is 12:45 PM.


Content Relevant URLs by vBSEO 3.5.0 RC2