usage of union

  • Thread starter Thread starter Pierre
  • Start date Start date
P

Pierre

Hi all,

I have 2 tables to merge in one table (with the same fields).

So i append the data from the second table to the first one.

And i do all the work with the first table.

Recently i discover a union query. It work and may simplify the management
ot tables for me but, I have the feeling that with the union the things are
really slower.

Is a union something to avoid? when you use them? only on small data sets?

Is there some things to follow to avoid sluggish response?

What is the right way to do the merge, is my original way the simplest and
fastest?

regards,
pierre
 
Good question except that you didn't define "do all the work". We have no
idea what this means.

If you want to be able to edit your data, a union query will not work. A
union query will increase dramatically in performance if you use "UNION ALL"
rather than simply "UNION":

SELECT FirstName, LastName, Address, Phone
FROM tblSuppliers
UNION ALL

SELECT FirstName, LastName, Address, Phone
FROM tblCustomers;

Appending and deleting records from tables will cause file bloat. This can
be minimized with regular compacting or using temporary MDB files for
temporary tables.
 
Back
Top