For DB2…
table1.a is varchar(30) and has an index on it.
table2.b is varchar(45) and has an index on it.
Will table1.a = table2.b use the index on table1, table2, or both?
Although it would seem obvious that it should use both indexes, I’m asking because I believe on sybase, this would only use one of the indexes (I’m not sure which one).
I fully intend to test this out, but I am unable to presently.
Use EXPLAIN on your query to determine what indexes it is using. For more information see this link:
http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db2z10.doc.perf/db2z_captureexplaininfo.htm