cancel
Showing results for 
Search instead for 
Did you mean: 

Which table to choose from in Select?

MCMartin
Participant
0 Kudos
1,748

When 2 tables are joined, with a relation 1:100 like:

Table A: Col1, Col2, Col3
Table B: Col1, Col2, Col4, Col5

Executing a statement like:

Select Col1,Col2,Col4,Col5 from A key join B where Col3=x

When thinking of performance which one is better, selecting Col1 and Col2 from table A or from table B or is it equal?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member

I always prefer to choose cols from central table (in your case it's table A). But it's not because of performance, but because of factor that any sql in future can be modified. In the case of key join may be there are no difference, but if in future you must switch from key join for example to outer joins, so it's be much easy to made modifications to sql query. And I am always prefer to use table aliases.