|
|
Choosing A Webhost: |
Bad performance in a OR query: msg#00268db.maxdb
Hi, I'm working on the usage of MaxDB in the RT System (http://bestpractical.com/rt/). I'm using MaxDB 7.0.5.19. I obtain really bad performances on some queries. This is the part of a query which is not well using indexes: SELECT main.id FROM Groups main, ACL ACL_1 WHERE ((ACL_1.PrincipalId = main.id AND ACL_1.PrincipalType = 'Group') OR (main.Domain = 'RT::Queue-Role' AND main.Instance = 3 AND main.Type = ACL_1.PrincipalType)) This query is not using my indexes, the explain commands gives to me: '';'ACL_1';'';'TABLE SCAN';' 1' '';'MAIN';'';'TABLE SCAN';' 580' '';'';'';' RESULT IS COPIED , COSTVALUE IS';' 316698' But the following query gives a similar result (if we don't concider duplicates values): SELECT main.id FROM Groups main, ACL ACL_1 WHERE ACL_1.PrincipalId = main.id AND ACL_1.PrincipalType = 'Group' UNION SELECT main.id FROM Groups main, ACL ACL_1 WHERE main.Domain = 'RT::Queue-Role' AND main.Instance = 3 AND main.Type = ACL_1.PrincipalType and this query uses my indexes and is much faster. For this query the execution plan is: '';'ACL_1';'';'TABLE SCAN';' 1' '';'MAIN';'ID';'JOIN VIA KEY COLUMN';' 580' '';'ACL_1';'';'TABLE SCAN';' 1' '';'MAIN';'GROUPS1';'JOIN VIA RANGE OF MULTIPLE INDEXED COL.';' 580' '';'';'DOMAIN';' (USED INDEX COLUMN)';'' '';'';'INSTANCE';' (USED INDEX COLUMN)';'' '';'';'';' RESULT IS COPIED , COSTVALUE IS';' 19' The optimization is not well working when I'm using the query with "OR". Notes that the real query is more complex. This is just a part to show that indexes are not used with combination of conditions with a "OR". Is this possible to configure MaxDB to correctly use indexes in the case ? Thanks a lot for your help. Michael Fernandez DMS GmbH. -- MaxDB Discussion Mailing List For list archives: http://lists.mysql.com/maxdb To unsubscribe: http://lists.mysql.com/maxdb?unsub=gcdm-maxdb@xxxxxxxxxxx
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | AW: MaxDB 7.5 - Some technical questions, Zabach, Elke |
|---|---|
| Next by Date: | AW: Bad performance in a OR query, Becker, Holger |
| Previous by Thread: | AW: MaxDB 7.5 - Some technical questions, Zabach, Elke |
| Next by Thread: | AW: Bad performance in a OR query, Becker, Holger |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |
Home
| advertise | OSDir is
an inevitable website.
|