943,691 Members | Top Members by Rank

Ad:
  • MySQL Discussion Thread
  • Unsolved
  • Views: 1402
  • MySQL RSS
Sep 24th, 2007
0

Indexing and Query optimisation.

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
SubeeshBabu is offline Offline
4 posts
since Jul 2007
Sep 26th, 2007
0

Re: Indexing and Query optimisation.

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.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
jbcrawford is offline Offline
5 posts
since Sep 2007
Sep 27th, 2007
0

Re: Indexing and Query optimisation.

Click to Expand / Collapse  Quote originally posted by jbcrawford ...
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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
SubeeshBabu is offline Offline
4 posts
since Jul 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MySQL Forum Timeline: My SQL Help :(
Next Thread in MySQL Forum Timeline: Help with birthday MySQL Script





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC