cancel
Showing results for 
Search instead for 
Did you mean: 

TABLE SCAN strategy instead of using index

Former Member
0 Kudos

Using MAXDB 7.6.037

I have SQL query that has 50 conditions connected by OR clause, something like that:

Select m.id, m.methodSignature, m.class_Id, m.packageId From methods m Where (m.class_Id = 198158602647645803 AND m.SHC = -2091301697) OR (m.class_Id = 198158602647645445 AND m.SHC = -1050620450) OR (m.class_Id = 198158602647645114 AND m.SHC = -795333832) OR (m.class_Id = 198158602647645586 AND m.SHC = -795333832) OR (m.class_Id = 198158602647645609 AND m.SHC = 1842641906) OR ....

There is composed index on class_Id, SHC

"Explain" shows "Table Scan". If I remove one clause it uses index. And works considerably faster.

I've checked the same query on SAPDB 7.4 and the number of OR conditions is 51 for server "dropping the idea to use index"

My question is is it somekind of limitation for MAXDB that I can count on, so I'll use 2 queries instead of one?

Thanks,

Anya

Accepted Solutions (1)

Accepted Solutions (1)

roland_mallmann
Advisor
Advisor
0 Kudos

Hi Anya,

hm, is your used version 7.6.00 Build 37 or 7.6.03 Build 07?

Depending on your answer to the above question, I can tell you this:

a) 7.6.00 Build 37: limited to 50 ORs. Solution: upgrade to newest available version; I'd recommend 7.6.03 Build 07

b) 7.6.03 Build 07: no such limits, but if the problem occurs here, we need to find out why.

Regards,

Roland

Answers (0)