Indexing and Query optimisation.

Reply

Join Date: Jul 2007
Posts: 4
Reputation: SubeeshBabu is an unknown quantity at this point 
Solved Threads: 0
SubeeshBabu's Avatar
SubeeshBabu SubeeshBabu is offline Offline
Newbie Poster

Indexing and Query optimisation.

 
0
  #1
Sep 24th, 2007
Hi,
i am having a problem with indexing. In my database, one of my table have 3 foreign key references, All these fields are indexed by default. I need to create an index for a regular seach item. is there any problem regarding performance, if i combine the primary key and the field i mentioned above for indexing? Also if i am creating an index for a primary key separately will the performance degrade? MySql didnot show any error when i created an idex for a primary key.
But it showed a warning that there is an index for same field.
Please give me your suggestion regarding this
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 4
Reputation: jbcrawford is an unknown quantity at this point 
Solved Threads: 0
jbcrawford's Avatar
jbcrawford jbcrawford is offline Offline
Newbie Poster

Re: Indexing and Query optimisation.

 
0
  #2
Sep 26th, 2007
Your primary key is already indexed by default. Creating a second index just wastes memory but should not decrease performance. If you want to know more on how MySQL handles indexes check out their documentation.

http://dev.mysql.com/doc/refman/5.0/...l-indexes.html

And for query optimization maybe look at multi-column indexes if you are passing more than one condition.
"Time is the quality of nature that keeps events from happening all at once. Lately it doesn't seem to be working." ~Anonymous
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 4
Reputation: SubeeshBabu is an unknown quantity at this point 
Solved Threads: 0
SubeeshBabu's Avatar
SubeeshBabu SubeeshBabu is offline Offline
Newbie Poster

Re: Indexing and Query optimisation.

 
0
  #3
Sep 27th, 2007
Originally Posted by jbcrawford View Post
Your primary key is already indexed by default. Creating a second index just wastes memory but should not decrease performance. If you want to know more on how MySQL handles indexes check out their documentation.

http://dev.mysql.com/doc/refman/5.0/...l-indexes.html

And for query optimization maybe look at multi-column indexes if you are passing more than one condition.
Thank you very much
Last edited by SubeeshBabu; Sep 27th, 2007 at 12:56 am.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the MySQL Forum


Views: 1204 | Replies: 2
Thread Tools Search this Thread



Tag cloud for MySQL
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC