| | |
Indexing and Query optimisation.
Please support our MySQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
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
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
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.
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
•
•
•
•
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.
Last edited by SubeeshBabu; Sep 27th, 2007 at 12:56 am.
![]() |
Similar Threads
- Sql Query (VB.NET)
- All you need for Search Engine Optimization (SEO) (Search Engine Optimization)
- Turn Off Indexing to Speed Up XP (Windows tips 'n' tweaks)
- Removing Query Strings (ASP.NET)
- All You Need for SEO (Search Engine Optimization) - Resources List (Search Engine Optimization)
- Double MySQL Query (PHP)
- Database Limit (MS SQL)
- Query Building (Database Design)
Other Threads in the MySQL Forum
- Previous Thread: My SQL Help :(
- Next Thread: Help with birthday MySQL Script
| Thread Tools | Search this Thread |
Tag cloud for MySQL
1 agplv3 alfresco api artisticlicense aws bizspark breathalyzer camparingtocolumns cmg communityjournalism contentmanagement contractors copyright count court data database design developer development distinct drupal dui ec2 email enter enterprise error eudora facebook form foss gnu government gpl greenit groklaw hiring hyperic images innerjoins insert ip joebrockmeier join journalism keyword keywords kickfire law legal license licensing maintenance managing mariadb matchingcolumns metron micromanage microsoft microsoftexchange montywidenius mozilla multiple music mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch news open-xchange opendatabasealliance opengovernment opensource oracle penelope php query referencedesign reorderingcolumns resultset saas search select sharepoint simpledb sourcecode spotify sql sugarcrm syntax techsupport thunderbird transparency update virtualization





