on 2018 Jan 31 4:15 AM
Hi Sorry if I posted this on the wrong group
Testing Sybase 16(with latest ebf) after upgraded our databases from Sybase 12.
I found that query which take second in Sybase 12 are now taking hours/minutes.
I can rewrite the queries with union but this is not the answer as we have hundreds of scripts, it is a major problem.
The database engine struggles when you have mixture of OR with AND from example
SELECT COUNT(id)
FROM TableA
WHERE ColumnA = 0
AND ( ( ID in (SELECT A.Id
FROM A
INNER JOIN B ON A.id = B.id
inner join C on A.id = B.id
WHERE C.ColumnA = 0
AND B.ColumnA = 0 )
OR ID in(SELECT D.Id
FROM D
INNER JOIN E ON D.id = E.id
inner join C on C.id = E.id
WHERE C.ColumnA = 0
AND D.ColumnA = 0 )
OR ID in(SELECT G.Id
FROM G
INNER JOIN H ON H.id = G.id
inner join C ON C.id = H.id
WHERE C.ColumnA = 0
AND H.ColumnA = 0 ))
)
What changes can I try on the database engine(setting, option) to optimise the query without rewriting them?
Thanks
Request clarification before answering.
Really daft question, but what OS is this, and does it have the latest patches? I found some things slowed down dramatically (way more than the advertised 25%) with the meltdown/spectre patches. Hopefully this is a red herring for you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
61 | |
8 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.