Jump to content
Larry Ullman's Book Forums

Recommended Posts

I have a question concerning indexing INNER JOIN rows:

 

Example: Table1 has a column "countryKey" (INT), and a column "name" (TEXT).

Table2 also has a column "countryKey" (INT), and a column "zipcode" (TEXT).

 

An INNER JOIN query using these tables would look something like this:

SELECT Table1.name, Table2.zipcode FROM Table1 INNER JOIN Table2 USING(countryKey).

 

My question: should I index the countryKey column in Table1, Table2, or both?

Link to comment
Share on other sites

 Share

×
×
  • Create New...