User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 456,507 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,663 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums
Views: 790 | Replies: 2
Reply
Join Date: Jul 2007
Posts: 3
Reputation: SubeeshBabu is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
SubeeshBabu's Avatar
SubeeshBabu SubeeshBabu is offline Offline
Newbie Poster

Question Indexing and Query optimisation.

  #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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2007
Location: Durant, OK
Posts: 4
Reputation: jbcrawford is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
jbcrawford's Avatar
jbcrawford jbcrawford is offline Offline
Newbie Poster

Re: Indexing and Query optimisation.

  #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  
Join Date: Jul 2007
Posts: 3
Reputation: SubeeshBabu is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
SubeeshBabu's Avatar
SubeeshBabu SubeeshBabu is offline Offline
Newbie Poster

Re: Indexing and Query optimisation.

  #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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MySQL Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the MySQL Forum

All times are GMT -4. The time now is 3:43 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC