MySQL speed up query with index?

I am comparing 2 tables each with common field called mniNum and removing duplicate records from the one table by comparing records in each table.   If I create an index in each table using the common field will that help speed up the process?

What else can I do to speed up a query that must compare each record between two tables?
pda4meAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Leo TorresConnect With a Mentor SQL DeveloperCommented:

Well sounds like you have answered you own question if this column your comparing is not a primary key then write an index for that column..

FYI.. Primary Keys automaically get an index Clustered Indexs

You you have to create an index on a column that is a non-clustered Index

These indexs will imporve look times on tables

By imporoving Lookup when you add Indexs on a table you will increase insert times so I hope you dont have a lot of inserts to this table or large inserts for that fact ..

You have a trade of there you going to have to deal with and decide which is more important..

good luck!!
0
 
theGhost_k8Database ConsultantCommented:
surely it will. use Explain <QUERY> to find out index hints.
If you can post your queries and table definition it'd be clear picture.
0
 
pda4meAuthor Commented:
Ltorres,  will delete also be increased in addition to insert times when there is an index?  I am actually comparing the tables and removing records.
0
 
Leo TorresSQL DeveloperCommented:
Yes corect deletes as well

Here is a good resource
http://download.oracle.com/docs/cd/B10501_01/server.920/a96533/data_acc.htm

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.