Union Query design

I

Ian Chappel

I need to create a number of Union queries, based on tables with a number of
common ID fields, such as TraderID.

My question is, is it better to join the two raw tables in a Union Query,
and then query the Union Query with a Join to tblTraders to display
TraderName etc., or create the Joins first and then Union them together?

The first option would seem to be the most efficient, although with my
limited SQL abilities I would have two queries rather than one. Which leads
to a related question - do nested simple queries (queries on queries) run
much slower than more complex single ones? I have one case which involves
perhaps 5 layers of nesting, but seems to run fine at the moment, although
the database is fairly empty now.
 
A

Allen Browne

There are too many variables here to give you a standard answer: table
structures and indexes, numbers of records in the related tables, caching,
etc.

The only way to find out is for your to run some tests.
 
I

Ian Chappel

OK, thanks - will do.

Allen Browne said:
There are too many variables here to give you a standard answer: table
structures and indexes, numbers of records in the related tables, caching,
etc.

The only way to find out is for your to run some tests.
 
Top