usage of union

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
 
D

Duane Hookom

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top