cancel
Showing results for 
Search instead for 
Did you mean: 

Sybase 16 query using OR's and AND's very slow compared to Sybase 12

Former Member
0 Kudos
2,295

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

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

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.

Former Member
0 Kudos

windows 10 pro 64bit with 64GB with all the latest patches.