| | |
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
Views: 1204 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for MySQL
"use" 1 agplv3 alfresco amazon api artisticlicense breathalyzer camparingtocolumns changingprices cmg contentmanagement count court crm data database design developer development drupal dui ec2 eliminate email enter enterprise error eudora facebook form foss gartner gnu government gpl greenit groklaw groupware images innerjoins insert ip joebrockmeier join journalism keywords laptop law legal license licensing linux maintenance managing matchingcolumns metron micromanage microsoft microsoftexchange mindtouch montywidenius mozilla multiple music mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch news open-xchange opendatabasealliance opengovernment opensource operand oracle pdf penelope php priceupdating referencedesign remove reorderingcolumns resultset saas select sharepoint sourcecode spotify sql sugarcrm syntax techsupport thunderbird transparency update virtualization





