473,466 Members | 1,372 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Using a lot of Tempspace

This sql statement dies after using more than 40GB Tempspace:

INSERT INTO dcp.cmp_mo_p_bab_kart ( currency, year,
figure, period, month_date, company, center, account,
value )
SELECT
CASE
WHEN src.currency IS null
THEN dest.currency
ELSE src.currency END AS currency ,
CASE
WHEN src.year IS null
THEN dest.year
ELSE src.year END AS year ,
CASE
WHEN src.figure IS null
THEN dest.figure
ELSE src.figure END AS figure ,
CASE
WHEN src.period IS null
THEN dest.period
ELSE src.period END AS period ,
CASE
WHEN src.month_date IS null
THEN dest.month_date
ELSE src.month_date END AS month_date ,
CASE
WHEN src.company IS null
THEN dest.company
ELSE src.company END AS company ,
CASE
WHEN src.center IS null
THEN dest.center
ELSE src.center END AS center ,
CASE
WHEN src.account IS null
THEN dest.account
ELSE src.account END AS account , COALESCE(src.value,0)
AS value
FROM dcp.t_mo_p_bab_kart src FULL OUTER JOIN (
SELECT DISTINCT d.currency AS currency , d.year AS
year , d.figure AS figure , d.period AS period ,
d.month_date AS month_date , d.company AS company
, d.center AS center , d.account AS account , d.value
AS value
FROM dcp.mo_p_bab_kart d , dcp.t_mo_p_bab_kart s
WHERE d.company = s.company and d.year = s.year and
d.period = s.period and d.month_date = s.month_date
and d.figure = s.figure and d.currency = s.currency
) dest ON src.company = dest.company AND src.center
= dest.center AND src.year = dest.year AND src.period
= dest.period AND src.month_date = dest.month_date
AND src.figure = dest.figure AND src.currency =
dest.currency AND src.account = dest.account

Table dcp.mo_p_bab_kart has 2129489 cards , dcp.t_mo_p_bab_kart 189424
cards,
Runstats ok.

Perhaps is it better to use UNION ALL or work with temporary table?

WHY?

--
Mit freundlichen Gruessen / Best regards
_______________________________
Joachim Mueller
Nov 12 '05 #1
2 1826
Just a guess: Would it be semantically OK to place the DISTINCT in the
top-SELECT?
You should take a look at the plan and check for sorts and temps.

Cheers
Serge
Nov 12 '05 #2
Serge,

thank you for the hint.

Regards,
Joachim
"Serge Rielau" <sr*****@ca.eyebeem.com> schrieb im Newsbeitrag
news:bo**********@hanover.torolab.ibm.com...
Just a guess: Would it be semantically OK to place the DISTINCT in the
top-SELECT?
You should take a look at the plan and check for sorts and temps.

Cheers
Serge

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mehul Patel | last post by:
Our .Net team have been pondering about using keyword. We are using streams FileStream and BufferedStream. We use using keyword at FileStream, and not BufferedStream which wraps FileStream. So...
2
by: rawCoder | last post by:
Hi All, I have a *.cer file, a public key of some one and I want to encrypt some thing using this public key. Can someone point me to a sample code for Encrypting some file using...
5
by: Enos Meroka | last post by:
Hallo, I am a student doing my project in the university.. I have been trying to compile the program using HP -UX aCC compiler, however I keep on getting the following errors. ...
8
by: acb | last post by:
Hi, I wrote a DLL Component (using Visual Studio 2005) and managed to include it into a C# Console application. I am now trying to include this component into a Web project. I copy the DLL...
0
by: apple | last post by:
How large should tempspace be relative to the largest table in a database to do reorgs? Does tempspace have to be at least twice the size of the table being reorged. Assuming nothing is using...
0
by: Eugene Anthony | last post by:
The problem with my coding is that despite removing the records stored in the array list, the rptPages repeater control is still visible. The rptPages repeater control displayes the navigation...
3
by: JDeats | last post by:
I have some .NET 1.1 code that utilizes this technique for encrypting and decrypting a file. http://support.microsoft.com/kb/307010 In .NET 2.0 this approach is not fully supported (a .NET 2.0...
1
by: alexhguerra | last post by:
Hello Is it possible that a reorg index doesnt use a sys temporary tablespace and use the index tablespace in a reorg index? (db2 udb v8 fixpack 12 - there are 2 8k system tablespaces on this...
8
by: =?Utf-8?B?Q2hyaXMgSGFsY3Jvdw==?= | last post by:
Hi there I've successfully added some .NET validation controls to a page (using <asp:RequiredFieldValidator ...), however when I try to set the 'display' property to 'dynamic', my page then...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.