on 09-25-2007 4:29 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.