on 04-27-2016 2:32 PM
Is there way to set a timeout for long running SQL? MAX_QUERY_TIME doesn't work for INSERT/UPDATE/DELETE statements.
What exactly is the issue?
Are you doing row-by-row operations?
Are you issuing a 'commit' to allow the transaction to complete?
Chris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There is not setting.
Have you looked at the server log? What comprises 'complex' DML statements? Are you using cursors?
IQ performs best with set-based SQL and bulk operations. Your complex DML could still be turning into row-based operations, in which case you could be building up versions in IQ_MAIN and using IQ_SYSTEM_TEMP.
Check your .iqmsg file for any out of space errors.
Chris
There are no errors and we are not using cursor. The SQL is joining few large tables with billion+ rows.
For example,
INSERT INTO tmpTable1 (ID)
SELECT DISTINCT a.ID
FROM MainTable A
INNER JOIN Child1 B
ON A.ID = B.CustomerID
INNER JOIN Child2 C
ON A.ID = C.CustomerID
WHERE a.Gender = 'FEMALE'
AND
(
(b.Age = 26 OR b.Age = 27)
OR
(c.Age = 26 OR c.Age = 27)
)
MainTable has just 1 million rows but Child1 and Child2 as nearly 200 million rows.
That is not a lot of rows for IQ. What version are you running?
Can you post the HTML query plan?
Is the ID column in B and C a unique constraint or unique identifier (primary key or HG-U index)?
Have you added an HG index to A.Gender and b.Age and c.Age?
If you have not properly identified unique constraints, the optimizer may be trying to resolve a cartesian join. The query plan will show this.
You can also try placing the OR conditions in the join statement:
insert into tmpTable1 (ID)
select distinct A.ID from MainTable A
inner join Child1 B
on A.ID = B.CustomerID and B.Age in (26,27)
inner join Child2 C
on A.ID = C.CustomerID and C.Age in (26,27)
Also, what are your .cfg settings? Specifically -iqmc and -iqtc.
Chris
LF is fine for 15.4. What about Gender?
What service pack of 15.4? The OR processing might be part of the issue, depending on the release, but we should be able to see from your QP.
What is the configuration of your DBSPACE dbfiles? Are they on the same device? How many cores are you running?
Chris
Gender has LF index too.
Here is the version:
Sybase IQ/15.4.0.3019/120816/P/ESD 2/MS/Windows 2003/64bit/2012-08-16 10:58:36
Server is running Windows 2008 64bit with one socket and 4 cores, 196 GB or RAM. This server is part of a 3 node multiplex. We don't use distributed queries on the multiplex.
DBSPACE files are on a different LUNs.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.