Large Union Queries and Appending the data

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Here's a simple question that perhaps someone has
experience with. I have several large tables 10+ million
records in both Oracle and SQL environments that I wish
to summarize into a single Usage table.

I've written the group by queries for each table and I am
ready to append them to my new usage table. I've written
a union all query to add the pieces together before
appending them.

Does anyone have experience on large appends like this to
know if it's faster to append the union query, or run
several appends for the various group by queries?

Thanks

Mark
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

That depends on the machine that the query runs on: Lots of RAM? Fast
CPU?

I once ran a query that handled a very large dataset and it took a long
time. When we changed the query to run only on smaller datasets, in
sequential order, it took much less time for the total dataset.

So the answer is: try it both ways - all at once, or in sections.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQRzvG4echKqOuFEgEQIzMgCgq2UjDFio/7j+WN3+nKvz5bQpQlgAoJ57
wvDFI+lZY1bCjC5q5RIKBN+J
=oW7W
-----END PGP SIGNATURE-----
 
Back
Top