mysql,

tableA, definition:     key1 char(17) not null,
                        acct char(12),
                        other char (5)

tableB is same definiton like tableA.
I add index for both tableA and tableB like: alter table tableA add index(key1, acct)


I will do left join with tableA and tableB like :
tableA left join on tableB on tableA.acct=tableB.acct where....
tableB left join on tableA on tableB.acct=tableA.acct where....

The tableA has 32,000,000 records and tableB has 500,00 records.


I feel some thing wrong about how define the table fields, add index or something, because I only use acct field for left join on.
I hope I can change some table definition or about add index to improve the performance.



Also, I like to know what is difference between:


alter table tableA add index(key1, acct)

or
alter table tableA add index(key1)
alter table tableA add index(acct)

Any suggestion?
Thanks.


--------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



Reply via email to