Laas,<div><br></div><div>This SQL is too heavy and incorrect, RT 3.8.6 has a fix.<br><br><div class="gmail_quote">On Fri, Oct 23, 2009 at 1:00 PM, Laas Toom <span dir="ltr"><<a href="mailto:laas.toom@eenet.ee">laas.toom@eenet.ee</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word"><div>Hello!</div><div><br></div><div>We have RT with ca 50 000 tickets in it, which, I think, has been running since 3.2 and upgraded lately to 3.8.5. After that I added RT-IR to it and everything seems to be fine except the Lookup IP query. First of all it takes ages. MySQL slow log reports query_time in order of 500 to 800 seconds and rows examined 3 to 4 millions.</div>
<div><br></div><div>And after I wait through it I get irrelevant data - Incident Reports and Incidents, which do not have this IP nowhere in them.</div><div><br></div><div>Before I upgraded the RT and installed RTIR to it, I copied the whole database for testing (that means all the same content in it except newer tickets) and played around with RTIR a bit. I did not notice the slowness in the test database and IIRC the virgin production RTIR was fast also. But search results were irrelevant in test too (though at the time I hoped it was my testing that messed things up). And lookup in the production DB seems to grow slower with every Incident Report added.</div>
<div><br></div><div>Can somebody take a look at this query (taken from slow log) if this seems correct and why does RT join ObjectCustomFieldValues to itself 4 times and perform WHERE lookup on different fields in all of them.</div>
<div><br></div><div>Below are the query and it's explain from phpMyAdmin.</div><div><br></div><div>Best,</div><div>Laas</div><div><br></div><div><br></div><div>SELECT DISTINCT main.* FROM Tickets main JOIN ObjectCustomFieldValues ObjectCustomFieldValues_3 ON ( ObjectCustomFieldValues_3.CustomField = '14' ) AND ( ObjectCustomFieldValues_3.Disabled = '0' ) AND ( ObjectCustomFieldValues_3.ObjectType = 'RT::Ticket' ) AND ( </div>
<div>ObjectCustomFieldValues_3.ObjectId = <a href="http://main.id" target="_blank">main.id</a> ) JOIN ObjectCustomFieldValues ObjectCustomFieldValues_4 ON ( ObjectCustomFieldValues_4.Disabled = '0' ) AND ( ObjectCustomFieldValues_4.ObjectType = 'RT::Ticket' ) AND ( ObjectCustomFieldValues_4.CustomField = '14' ) </div>
<div>AND ( ObjectCustomFieldValues_4.ObjectId = <a href="http://main.id" target="_blank">main.id</a> ) JOIN ObjectCustomFieldValues ObjectCustomFieldValues_1 ON ( ObjectCustomFieldValues_1.CustomField = '14' ) AND ( ObjectCustomFieldValues_1.ObjectType = 'RT::Ticket' ) AND ( ObjectCustomFieldValues_1.Disabled = </div>
<div>'0' ) AND ( ObjectCustomFieldValues_1.ObjectId = <a href="http://main.id" target="_blank">main.id</a> ) JOIN Transactions Transactions_5 ON ( Transactions_5.ObjectId = <a href="http://main.id" target="_blank">main.id</a> </div>
<div>) JOIN ObjectCustomFieldValues ObjectCustomFieldValues_2 ON ( ObjectCustomFieldValues_2.Disabled = '0' ) AND ( ObjectCustomFieldValues_2.ObjectId = <a href="http://main.id" target="_blank">main.id</a> ) AND ( ObjectCustomFieldValues_2.ObjectType = 'RT::Ticket' ) AND ( ObjectCustomFieldValues_2.CustomField =</div>
<div> '14' ) WHERE (main.Status != 'deleted') AND (Transactions_5.ObjectType = 'RT::Ticket') AND ( ( ( ( ( ( ObjectCustomFieldValues_1.Content <= '193.040.010.218' OR ( ( ObjectCustomFieldValues_1.Content = '' OR ObjectCustomFieldValues_1.Content IS NULL ) AND </div>
<div>ObjectCustomFieldValues_1.LargeContent <= '193.040.010.218' ) ) ) ) AND ( ( ( ObjectCustomFieldValues_2.LargeContent >= '193.040.010.218' ) ) ) AND ( ( ( ObjectCustomFieldValues_3.Content >= '000.000.000.000' OR ( ( ObjectCustomFieldValues_3.Content</div>
<div> = '' OR ObjectCustomFieldValues_3.Content IS NULL ) AND ObjectCustomFieldValues_3.LargeContent >= '000.000.000.000' ) ) ) ) AND ( ( ( ObjectCustomFieldValues_4.LargeContent <= '255.255.255.255' ) ) ) ) ) AND ( Transactions_5.Created > '2009-08-08 10:56:21' ) ) AND (main.Type = 'ticket') AND (main.EffectiveId = <a href="http://main.id" target="_blank">main.id</a>)</div>
<div><br></div><div><span style="font-family:sans-serif;font-size:13px"><table><thead><tr><th style="font-weight:bold;color:rgb(0, 0, 0);background-repeat:initial;background-color:rgb(211, 220, 227);padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(255, 204, 153);border-right-color:rgb(255, 204, 153);border-bottom-color:rgb(255, 204, 153);border-left-color:rgb(255, 204, 153)">
id</th><th style="font-weight:bold;color:rgb(0, 0, 0);background-repeat:initial;background-color:rgb(211, 220, 227);padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
select_type</th><th style="font-weight:bold;color:rgb(0, 0, 0);background-repeat:initial;background-color:rgb(211, 220, 227);padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
table</th><th style="font-weight:bold;color:rgb(0, 0, 0);background-repeat:initial;background-color:rgb(211, 220, 227);padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
type</th><th style="font-weight:bold;color:rgb(0, 0, 0);background-repeat:initial;background-color:rgb(211, 220, 227);padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
possible_keys</th><th style="font-weight:bold;color:rgb(0, 0, 0);background-repeat:initial;background-color:rgb(211, 220, 227);padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
key</th><th style="font-weight:bold;color:rgb(0, 0, 0);background-repeat:initial;background-color:rgb(211, 220, 227);padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
key_len</th><th style="font-weight:bold;color:rgb(0, 0, 0);background-repeat:initial;background-color:rgb(211, 220, 227);padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
ref</th><th style="font-weight:bold;color:rgb(0, 0, 0);background-repeat:initial;background-color:rgb(211, 220, 227);padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
rows</th><th style="font-weight:bold;color:rgb(0, 0, 0);background-repeat:initial;background-color:rgb(211, 220, 227);padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
Extra</th></tr></thead><tbody><tr style="background-repeat:initial;background-color:rgb(229, 229, 229);text-align:left"><td align="right" style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(255, 204, 153);border-right-color:rgb(255, 204, 153);border-bottom-color:rgb(255, 204, 153);border-left-color:rgb(255, 204, 153)">
1</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">SIMPLE</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
ObjectCustomFieldValues_1</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">ref</td>
<td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">TicketCustomFieldValues1,TicketCustomFieldValues2,...</td>
<td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">ObjectCustomFieldValues3</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
263</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">const,const,const</td><td align="right" style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
3832</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">Using where; Using temporary</td>
</tr><tr style="background-repeat:initial;background-color:rgb(213, 213, 213);text-align:left"><td align="right" style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(255, 204, 153);border-right-color:rgb(255, 204, 153);border-bottom-color:rgb(255, 204, 153);border-left-color:rgb(255, 204, 153)">
1</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">SIMPLE</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
ObjectCustomFieldValues_3</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">ref</td>
<td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">TicketCustomFieldValues1,TicketCustomFieldValues2,...</td>
<td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">TicketCustomFieldValues1</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
8</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">const,rt3.ObjectCustomFieldValues_1.ObjectId</td>
<td align="right" style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">1</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
Using where</td></tr><tr style="background-repeat:initial;background-color:rgb(229, 229, 229);text-align:left"><td align="right" style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(255, 204, 153);border-right-color:rgb(255, 204, 153);border-bottom-color:rgb(255, 204, 153);border-left-color:rgb(255, 204, 153)">
1</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">SIMPLE</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
ObjectCustomFieldValues_4</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">ref</td>
<td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">TicketCustomFieldValues1,TicketCustomFieldValues2,...</td>
<td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">TicketCustomFieldValues1</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
8</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">const,rt3.ObjectCustomFieldValues_1.ObjectId</td>
<td align="right" style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">1</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
Using where</td></tr><tr style="background-repeat:initial;background-color:rgb(213, 213, 213);text-align:left"><td align="right" style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(255, 204, 153);border-right-color:rgb(255, 204, 153);border-bottom-color:rgb(255, 204, 153);border-left-color:rgb(255, 204, 153)">
1</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">SIMPLE</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
ObjectCustomFieldValues_2</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">ref</td>
<td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">TicketCustomFieldValues1,TicketCustomFieldValues2,...</td>
<td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">TicketCustomFieldValues1</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
8</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">const,rt3.ObjectCustomFieldValues_1.ObjectId</td>
<td align="right" style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">1</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
Using where</td></tr><tr style="background-repeat:initial;background-color:rgb(229, 229, 229);text-align:left"><td align="right" style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(255, 204, 153);border-right-color:rgb(255, 204, 153);border-bottom-color:rgb(255, 204, 153);border-left-color:rgb(255, 204, 153)">
1</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">SIMPLE</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
main</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">eq_ref</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
PRIMARY,Tickets3,Tickets4,Tickets5,Tickets6</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
PRIMARY</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">4</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
rt3.ObjectCustomFieldValues_2.ObjectId</td><td align="right" style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
1</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">Using where</td></tr><tr style="background-repeat:initial;background-color:rgb(213, 213, 213);text-align:left">
<td align="right" style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(255, 204, 153);border-right-color:rgb(255, 204, 153);border-bottom-color:rgb(255, 204, 153);border-left-color:rgb(255, 204, 153)">
1</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">SIMPLE</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
Transactions_5</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">ref</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
Transactions1</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">Transactions1</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
70</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">const,rt3.ObjectCustomFieldValues_1.ObjectId</td>
<td align="right" style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">1</td><td style="padding-top:0.1em;padding-right:0.5em;padding-bottom:0.1em;padding-left:0.5em;margin-top:0.1em;margin-right:0.1em;margin-bottom:0.1em;margin-left:0.1em;vertical-align:top">
Using where; Distinct<br><br></td></tr></tbody></table></span></div></div><br>_______________________________________________<br>
<a href="http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users" target="_blank">http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users</a><br>
<br>
Community help: <a href="http://wiki.bestpractical.com" target="_blank">http://wiki.bestpractical.com</a><br>
Commercial support: <a href="mailto:sales@bestpractical.com">sales@bestpractical.com</a><br>
<br>
<br>
Discover RT's hidden secrets with RT Essentials from O'Reilly Media.<br>
Buy a copy at <a href="http://rtbook.bestpractical.com" target="_blank">http://rtbook.bestpractical.com</a><br></blockquote></div><br><br clear="all"><br>-- <br>Best regards, Ruslan.<br>
</div>