| Anonymous | Login | Signup for a new account | 2010-09-03 06:21 MDT |
| Main | My View | View Issues | Change Log | Roadmap | Docs |
| Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||
| ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||
| 0000485 | [v2.0 Release (Current)] Core Infrastructure | trivial | have not tried | 2010-06-13 07:24 | 2010-06-21 23:06 | ||
| Reporter | egemme | View Status | public | ||||
| Assigned To | caseydk | ||||||
| Priority | normal | Resolution | fixed | ||||
| Status | closed | Product Version | |||||
| Summary | 0000485: new contacts_methods table and zero to many relationships | ||||||
| Description |
Hi, I'm concerned about how the contacts_methods have been implemented. At least in helpdesk because this is where I'm focused on at this time. In zero to many relationships, using a where clause to segregate the appropriate leaf record e.g. contact_method = 'primary_phone', will turn any left join into an inner join if there is no primary phone for a contact. Therefore, either the query misses many entries or returns nothing. In such case, I use to add a condition to the join to make it join only when all the conditions are met, otherwise fill the query fields with nulls. This is an ackward approach for SQL purists, but it delivers more performance with large leaf table since it doesn't have to join all the leaves for all branches but only the one needed: ... left join contacts_methods cm on cm.contact_id = c.contact_id and cm.method_name = 'primary_phone' ... It is ackward because people don't use to put litteral predicates in join conditions, and it doesn't work will all DB engines anyway. But it does with DB2 and MySQL. If you don't like it, you must then turn around and make the where clause look like this: ... where cm.contact_method = 'primary_phone' or cm.contact_method is null ... Otherwise, everytime a contact doesn't have a primary phone, the queried record won't be selected since the join didn't fill any of contact_method values and left them null. The left join turns into an inner join. I don't know the impact of this in all w2p, but in helpdesk, this caused a major break. |
||||||
| Additional Information | |||||||
| Tags | No tags attached. | ||||||
| Attached Files | |||||||
|
|
|||||||
| Mantis 1.1.8[^] Copyright © 2000 - 2009 Mantis Group |